Skip to content

Commit

Permalink
ci(actions): replace release system and modify makefile (#105)
Browse files Browse the repository at this point in the history
## Description

### PR Description:

This pull request refactors the CI/CD and release process by modifying
the GitHub Actions workflows and restructuring the `Makefile` to
streamline build, deployment, and testing tasks. Key changes include:

1. **Release Workflow Overhaul**:
- Replaced the previous release system to optimize and simplify the
release workflow.
- Removed obsolete configurations and added new GitHub Actions for
better automation and maintainability.
- Introduced a new action to automatically label and manage pull
requests, enhancing visibility and organization.

2. **Makefile Modifications**:
- Updated Makefile targets to support deploying the driver, addressing
key deployment needs.
- Cleaned up unused targets and added `gowrap` as a dependency,
facilitating code generation and build consistency.
- Improved non-root image configuration, enhancing container security
and compliance.

3. **Testing Enhancements**:
- Split unit and integration tests to enable parallel testing, improving
test coverage and speed.
- Added integration test runs to CI, ensuring more comprehensive
verification in PR checks.

4. **Other Updates**:
- Dropped generated changelog files and unnecessary dependencies from
the project, reducing repository size.
- Bumped the Go version to align with latest stability improvements and
security patches.
- Updated `.chainsaw.yaml` for templating support, improving flexibility
in configurations.

---------

Signed-off-by: Mateusz Urbanek <[email protected]>
  • Loading branch information
shanduur authored Oct 30, 2024
1 parent e137862 commit fc66b22
Show file tree
Hide file tree
Showing 47 changed files with 3,240 additions and 974 deletions.
7 changes: 7 additions & 0 deletions .chainsaw.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: chainsaw.kyverno.io/v1alpha2
kind: Configuration
metadata:
name: chainsaw
spec:
templating:
enabled: true
10 changes: 0 additions & 10 deletions .github/release-please-config.json

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/00-release-please.yaml

This file was deleted.

71 changes: 0 additions & 71 deletions .github/workflows/10-k8s.yaml

This file was deleted.

131 changes: 0 additions & 131 deletions .github/workflows/10-linters-tests-image.yaml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/autopilot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: autopilot

on: pull_request_target

jobs:
auto-approve:
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: |
contains(github.event.pull_request.labels.*.name, 'area/dependency') &&
!contains(github.event.pull_request.labels.*.name, 'do-not-merge') &&
github.actor == 'dependabot[bot]'
steps:
- uses: hmarr/auto-approve-action@v4
29 changes: 29 additions & 0 deletions .github/workflows/helm-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: helm-release

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: fregante/setup-git-user@v2
- uses: azure/setup-helm@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- id: releaser
uses: helm/chart-releaser-action@v1
env:
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
charts_dir: ./helm
config: .cr.yaml
53 changes: 53 additions & 0 deletions .github/workflows/kubernetes-linters.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: kubernetes-linters

on:
pull_request:
branches: ["*"]
push:
branches:
- "main"

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v6
with:
configFile: .commitlintrc.mjs
token: ${{ secrets.GITHUB_TOKEN }}

chart-testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: azure/setup-helm@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v5
with:
python-version: "3.x"
check-latest: true
- uses: helm/chart-testing-action@v2
- run: |
ct lint --target-branch ${{ github.event.repository.default_branch }}
linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
cache: false
- run: |
make lint-manifests
- run: |
make \
generate-docs \
generate-schemas \
diff
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# This workflow is used to declaratively sync labels.
# It is supposed to be run on push to main.

name: Sync labels
name: labels

on:
push:
Expand Down
Loading

0 comments on commit fc66b22

Please sign in to comment.