Skip to content

fix(ci): add zizmor pedantic persona, suppress noisy findings, fix cache key #107

fix(ci): add zizmor pedantic persona, suppress noisy findings, fix cache key

fix(ci): add zizmor pedantic persona, suppress noisy findings, fix cache key #107

Workflow file for this run

name: Exitdir E2E Tests
on:
pull_request:
branches:
- main
permissions: {}
defaults:
run:
shell: bash
working-directory: ./src/github.com/chainguard-dev/exitdir
jobs:
exitdir-tests:
name: e2e tests
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false # Keep running if one leg fails.
matrix:
k8s-version:
- v1.33.x
- v1.34.x
env:
GOPATH: ${{ github.workspace }}
GO111MODULE: on
GOFLAGS: -ldflags=-s -ldflags=-w
KO_DOCKER_REPO: registry.local:5000/exitdir
KOCACHE: ~/ko
COSIGN_EXPERIMENTAL: true
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
with:
egress-policy: audit
- name: Check out our repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: ./src/github.com/chainguard-dev/exitdir
persist-credentials: false
- uses: chainguard-dev/actions/setup-mirror@4a81273c8653122cf4e48cc248f9073b660c5e6d # v1.6.18
- name: Set up Go
id: setup-go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: '1.25'
check-latest: true
cache: false
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/go/pkg/mod
~/.cache/go-build
${{ env.KOCACHE }}
key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-
- uses: step-security/setup-ko@3b4d97844e4277c74a9d77ac00052d8ce96580d3 # v0.9.0
with:
version: v0.18.1
- name: Setup Cluster
uses: chainguard-dev/actions/setup-kind@4a81273c8653122cf4e48cc248f9073b660c5e6d # v1.6.18
id: kind
with:
k8s-version: ${{ matrix.k8s-version }}
registry-authority: registry.local:5000
cluster-suffix: cluster.local
- name: Create sample job
run: |
ko apply -f - <<EOF
apiVersion: batch/v1
kind: Job
metadata:
name: example
spec:
template:
spec:
restartPolicy: Never
containers:
- name: leader
image: ko://chainguard.dev/exitdir/cmd/leader
env:
- name: EXIT_DIR
value: "/var/exitdir"
volumeMounts:
- name: exit-dir
mountPath: "/var/exitdir"
- name: follower
image: ko://chainguard.dev/exitdir/cmd/follower
env:
- name: EXIT_DIR
value: "/var/exitdir"
volumeMounts:
- name: exit-dir
mountPath: "/var/exitdir"
volumes:
- name: exit-dir
emptyDir: {}
EOF
- name: Wait for job completion
run: |
kubectl wait --for=condition=complete --timeout=60s job/example
kubectl logs job/example --all-containers
- name: Collect diagnostics
if: ${{ failure() }}
uses: chainguard-dev/actions/kind-diag@4a81273c8653122cf4e48cc248f9073b660c5e6d # v1.6.18
with:
artifact-name: logs.${{ matrix.k8s-version }}