Skip to content

chore: add apply configurations for older wg-policy APIs #3760

chore: add apply configurations for older wg-policy APIs

chore: add apply configurations for older wg-policy APIs #3760

Workflow file for this run

---
name: CI
on:
pull_request: {}
push:
branches:
- main
concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
golangci-lint:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: go.mod
- uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6.0.1
with:
# renovate: datasource=go depName=github.com/golangci/golangci-lint
version: v1.59.1
args: --timeout 5m
yaml-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c # v3.1.1
markdown-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: nosborn/github-action-markdown-cli@9b5e871c11cc0649c5ac2526af22e23525fa344d # v3.3.0
with:
files: .
verify-generated:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: go.mod
- name: Generate all
run: |
make generate-all
- name: Verify changed files
uses: tj-actions/verify-changed-files@ab875806658e59162bc5f42e4df5c2d4682c459e # v20.0.0
id: verify-changed-files
with:
files: |
**/*
- name: Fail job is any changed files
if: steps.verify-changed-files.outputs.files_changed == 'true'
env:
CHANGED_FILES: ${{ steps.verify-changed-files.outputs.changed_files }}
run: |
errorMsg="::error::\
Changed files: $CHANGED_FILES\
\nPlease run 'make generate-all' locally and commit the changes"
echo -e "$errorMsg" && exit 1
test:
needs: verify-generated
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: go.mod
- run: make test
env:
KUBEBUILDER_ATTACH_CONTROL_PLANE_OUTPUT: true
e2e-test:
needs: verify-generated
runs-on: ubuntu-latest-4-cores
env:
IMG: registry.dummy-domain.com/image-scanner/controller:dev
IMG_FILE: operator-image.tar
K3D_CLUSTER: image-scanner
# renovate: datasource=github-tags depName=k3d-io/k3d
K3D_VERSION: v5.7.2
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: go.mod
- uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee # v3.1.0
- uses: docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4 # v3.4.0
- uses: docker/build-push-action@a254f8ca60a858f3136a2f1f23a60969f2c402dd # v6.4.0
with:
context: .
outputs: type=docker,dest=${{ env.IMG_FILE }}
tags: ${{ env.IMG }}
cache-from: type=gha
cache-to: type=gha,mode=max
- uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 # v2.4.0
with:
cluster-name: ${{ env.K3D_CLUSTER }}
k3d-version: ${{ env.K3D_VERSION }}
args: >-
--config=test/e2e-config/k3d-config.yml
- run: |
kubectl cluster-info
kubectl version --output=yaml
- run: |
k3d image import ${{ env.IMG_FILE }} --cluster ${{ env.K3D_CLUSTER }}
make deploy-dependencies deploy
- name: Install Chainsaw
uses: kyverno/action-install-chainsaw@5d00c353f61f44f3b492c673420202d1b1374c3f # v0.2.6
- run: |
make e2e-test