-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #267 from pjbgf/refactor
Refactor build, test and release
- Loading branch information
Showing
33 changed files
with
523 additions
and
523 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
# GitHub settings / example values: | ||
# | ||
# org level vars: | ||
# - PUBLIC_REGISTRY: docker.io | ||
# repo level vars: | ||
# - PUBLIC_REGISTRY_REPO: rancher | ||
# repo level secrets: | ||
# - PUBLIC_REGISTRY_USERNAME | ||
# - PUBLIC_REGISTRY_PASSWORD | ||
|
||
permissions: | ||
contents: write # Upload artefacts to release. | ||
|
||
jobs: | ||
|
||
publish-public: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ vars.PUBLIC_REGISTRY }} | ||
username: ${{ secrets.PUBLIC_REGISTRY_USERNAME }} | ||
password: ${{ secrets.PUBLIC_REGISTRY_PASSWORD }} | ||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build and push all image variations | ||
run: | | ||
make image-push | ||
TAG="${TAG}-amd64" TARGET_PLATFORMS=linux/amd64 make image-push | ||
TAG="${TAG}-arm64" TARGET_PLATFORMS=linux/arm64 make image-push | ||
env: | ||
TAG: ${{ github.ref_name }} | ||
REPO: ${{ vars.PUBLIC_REGISTRY }}/${{ vars.PUBLIC_REGISTRY_REPO }} | ||
|
||
- run: make upload | ||
env: | ||
GH_TOKEN: ${{ github.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 'stable' | ||
- run: make validate | ||
|
||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Run tests across all platforms, to ensure developers | ||
# can use any environment to run basic tests. | ||
platform: [ubuntu-latest, windows-latest, macos-latest] | ||
|
||
runs-on: ${{ matrix.platform }} | ||
needs: [ validate ] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 'stable' | ||
|
||
- run: make test | ||
|
||
e2e: | ||
|
||
runs-on: ubuntu-latest | ||
needs: [ validate ] | ||
|
||
steps: | ||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Test building images | ||
run: make test-build | ||
|
||
- name: E2E Tests | ||
run: make e2e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
*.swp | ||
.idea | ||
/cis-operator | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
"disable-all": true, | ||
"enable": [ | ||
"govet", | ||
"golint", | ||
"revive", | ||
"goimports", | ||
"misspell", | ||
"ineffassign", | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.