-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Improve caching - Simplify names - Format yaml files
- Loading branch information
Showing
2 changed files
with
69 additions
and
81 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Run tests | ||
name: Test | ||
|
||
on: | ||
push: | ||
|
@@ -9,32 +9,83 @@ jobs: | |
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.21" | ||
go-version-file: go.mod | ||
|
||
- name: Run tests | ||
run: go test -v -race -coverprofile=coverage.txt ./... | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
|
||
test-kubernetes: | ||
name: e2e k3s ${{ matrix.k3s }} | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
id-token: write | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k3s }} | ||
|
||
strategy: | ||
# The e2e tests are flaky and often one of the jobs fails. The default setting | ||
# causes all other currently running jobs to abort and all need to be restarted. | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- k3s: v1.26 | ||
k8s-test: v1.26.12 | ||
- k3s: v1.27 | ||
k8s-test: v1.27.9 | ||
- k3s: v1.28 | ||
k8s-test: v1.28.5 | ||
- k3s: v1.29 | ||
k8s-test: v1.29.0 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/cache@v3 | ||
go-version-file: go.mod | ||
|
||
- uses: hetznercloud/tps-action@main | ||
|
||
- uses: hetznercloud/setup-hcloud@v1 | ||
|
||
- uses: yokawasa/[email protected] | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
setup-tools: | | ||
helm | ||
kubectl | ||
skaffold | ||
helm: v3.11.2 | ||
kubectl: v1.29.0 | ||
skaffold: v2.3.0 | ||
|
||
- name: Run tests | ||
env: | ||
K3S_CHANNEL: ${{ matrix.k3s }} | ||
K8S_TEST_VERSION: ${{ matrix.k8s-test }} | ||
SCOPE: gha-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.k3s }} | ||
run: | | ||
go vet ./... | ||
go test -v -race -coverprofile=coverage.txt $(go list ./... | grep -v e2e) | ||
curl -sLS https://get.k3sup.dev | sh | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
trap "hack/dev-down.sh" EXIT | ||
source <(hack/dev-up.sh) | ||
skaffold build --tag="e2e-${GITHUB_RUN_ID}-${GITHUB_RUN_NUMBER}" | ||
tag=$(skaffold build --tag="e2e-${GITHUB_RUN_ID}-${GITHUB_RUN_NUMBER}" --quiet --output="{{ (index .Builds 0).Tag }}") | ||
skaffold deploy --images=docker.io/hetznercloud/hcloud-csi-driver=$tag | ||
test/e2e/kubernetes/run-e2e-tests.sh | ||
deploy-manifests: | ||
name: Check deployment manifests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: yokawasa/[email protected] | ||
with: | ||
|
@@ -43,6 +94,7 @@ jobs: | |
helm: v3.11.2 | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Generate manifests from helm chart | ||
run: hack/update-deployment-yamls.sh | ||
|
||
|
@@ -54,8 +106,8 @@ jobs: | |
run: echo "::error title=Deployment Manifests outdated::Please run hack/update-deployment-yamls.sh and commit the changes to deploy/" | ||
|
||
helm-chart: | ||
name: Verify Helm Chart | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: yokawasa/[email protected] | ||
with: | ||
|
@@ -70,6 +122,7 @@ jobs: | |
run: | | ||
hack/update-helm-snapshots.sh | ||
git diff --exit-code -- deploy/ | ||
- name: Show warning | ||
if: ${{ failure() }} | ||
run: echo "::error title=Helm Snapshots outdated::Please run hack/update-helm-snapshots.sh and commit the changes to chart/.snapshots/" | ||
|
This file was deleted.
Oops, something went wrong.