Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
ci: refactor verification job
Browse files Browse the repository at this point in the history
Merge API and Helm documentation tests into Verification workflow for
speeding up the CI runs.
  • Loading branch information
chrisgacsal committed Feb 22, 2024
1 parent 8a72a89 commit c77a09f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 53 deletions.
53 changes: 0 additions & 53 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,59 +13,7 @@ concurrency:
cancel-in-progress: true

jobs:
api-verification:
name: API Verification
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
with:
# NOTE(chrisgacsal): Use actions/cache for caching Go dependency and build caches
# as if provides better flexibility like setting the cache key which reduces cache misses significantly.
cache: false
go-version-file: '.go-version'

- name: Setup Go caching
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ github.ref_name }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ github.ref_name }}-
${{ runner.os }}-go-${{ github.event.repository.default_branch }}-
- name: Generate API code
run: make gen-api

# This step will evaluate the repo status and exit if found changes
# This should detect if the most up-to-date generated API code was pushed
- name: Changes validation
run: |
[[ -z "$(git status --porcelain)" ]] || exit 1
helm-docs-verification:
name: Helm Docs Verification
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Generate Helm Docs
run: make gen-helm-docs

# This step will evaluate the repo status and exit if found changes
# This should detect if the most up-to-date generated helm docs were pushed
- name: Changes validation
run: |
[[ -z "$(git status --porcelain)" ]] || exit 1
verification:
needs: api-verification
name: Verification
uses: ./.github/workflows/reusable-verification.yml
secrets: inherit
Expand Down Expand Up @@ -95,7 +43,6 @@ jobs:
needs:
- build
- e2e
- helm-docs-verification
name: Success
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/reusable-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ jobs:
- name: Run linters for Helm
run: |
make gen-helm-docs
make lint-helm
[[ -z "$(git status --porcelain)" ]] || exit 1
- name: Run linters for Azure/Bicep
run: |
Expand Down Expand Up @@ -105,6 +107,11 @@ jobs:
${{ runner.os }}-go-${{ github.ref_name }}-
${{ runner.os }}-go-${{ github.event.repository.default_branch }}-
- name: Verify APIs
run: |
make gen-api
[[ -z "$(git status --porcelain)" ]] || exit 1
- name: Verify go modules
run: |
make gomod-list
Expand Down

0 comments on commit c77a09f

Please sign in to comment.