chore(deps): lock file maintenance (#237) #557
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
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github. run_id }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up Nix | |
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v27 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: Set up magic Nix cache | |
uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b # v8 | |
- name: Set up Go cache | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ github.job }}-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ github.job }}-${{ runner.os }}-go- | |
- name: Prepare Nix shell | |
run: nix develop --impure .#ci | |
- name: Build | |
run: nix develop --impure .#ci -c make build | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up Nix | |
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v27 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: Set up magic Nix cache | |
uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b # v8 | |
- name: Set up Go cache | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ github.job }}-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ github.job }}-${{ runner.os }}-go- | |
- name: Prepare Nix shell | |
run: nix develop --impure .#ci | |
- name: Test | |
run: nix develop --impure .#ci -c make test | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up Nix | |
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v27 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: Set up magic Nix cache | |
uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b # v8 | |
- name: Set up Go cache | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ github.job }}-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ github.job }}-${{ runner.os }}-go- | |
- name: Prepare Nix shell | |
run: nix develop --impure .#ci | |
- name: Lint | |
run: nix develop --impure .#ci -c make lint -j | |
license-check: | |
name: License check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up Nix | |
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v27 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: Set up magic Nix cache | |
uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b # v8 | |
- name: Set up Go cache | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ github.job }}-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ github.job }}-${{ runner.os }}-go- | |
- name: Cache license information | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
with: | |
path: .licensei.cache | |
key: licensei-v1-${{ github.ref_name }}-${{ hashFiles('go.sum') }} | |
restore-keys: | | |
licensei-v1-${{ github.ref_name }} | |
licensei-v1-main | |
licensei-v1 | |
- name: Prepare Nix shell | |
run: nix develop --impure .#ci | |
- name: Populate license cache | |
run: nix develop --impure .#ci -c licensei cache | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check licenses | |
run: nix develop --impure .#ci -c make license-check | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
dev: | |
name: Developer environment | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up Nix | |
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v27 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: Set up magic Nix cache | |
uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b # v8 | |
- name: Check | |
run: nix flake check --impure | |
- name: Dev shell | |
run: nix develop --impure | |
artifacts: | |
name: Artifacts | |
uses: ./.github/workflows/artifacts.yaml | |
with: | |
publish: ${{ github.event_name == 'push' }} | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
security-events: write | |
dependency-review: | |
name: Dependency review | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Dependency Review | |
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0 | |
e2e-test: | |
name: E2E test | |
runs-on: ubuntu-latest | |
needs: [artifacts] | |
strategy: | |
matrix: | |
k8s_version: ["v1.28.9", "v1.29.4", "v1.30.0"] | |
operator_version: ["v1.22.1", "v1.22.2", "v1.22.3"] # First version that works with the generic webhook: v1.22.1 | |
# vault_version: ["1.11.12", "1.12.8", "1.13.4", "1.14.8"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up Nix | |
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v27 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: Set up magic Nix cache | |
uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b # v8 | |
- name: Prepare Nix shell | |
run: nix develop --impure .#ci | |
- name: Download docker image | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: "[container-image] Docker tarball" | |
- name: Download helm chart | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: "[helm-chart] package" | |
- name: Test | |
run: nix develop --impure .#ci -c make test-e2e | |
env: | |
KIND_K8S_VERSION: ${{ matrix.k8s_version }} | |
LOAD_IMAGE_ARCHIVE: ${{ github.workspace }}/docker.tar | |
WEBHOOK_VERSION: ${{ needs.artifacts.outputs.container-image-tag }} | |
OPERATOR_VERSION: ${{ matrix.operator_version }} | |
# VAULT_VERSION: ${{ matrix.vault_version }} | |
HELM_CHART: "${{ github.workspace }}/${{ needs.artifacts.outputs.helm-chart-package }}" | |
LOG_VERBOSE: "true" |