Add kyverno policy for adjusting the resoures for foreign platform builds #2514
This file contains hidden or 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: Run Chainsaw tests | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - '.github/workflows/chainsaw-tests.yaml' | |
| - 'components/kyverno/**' | |
| - 'components/policies/**' | |
| jobs: | |
| find-chainsaw-tests: | |
| name: Find chainsaw tests | |
| runs-on: ubuntu-latest | |
| outputs: | |
| directories: ${{ steps.list-tests.outputs.directories }} | |
| steps: | |
| - name: Checkout Git Repository | |
| uses: actions/checkout@v4 | |
| - id: list-tests | |
| run: | | |
| DIRS=$(find -name .chainsaw-test -type d | jq -R -s -c 'split("\n")[:-1]') | |
| echo "directories=${DIRS}" >> $GITHUB_OUTPUT | |
| chainsaw-test: | |
| name: Run Chainsaw tests | |
| runs-on: ubuntu-latest | |
| needs: ["find-chainsaw-tests"] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| directory: ${{ fromJSON(needs.find-chainsaw-tests.outputs.directories) }} | |
| steps: | |
| - name: Create k8s Kind Cluster | |
| uses: helm/kind-action@v1 | |
| - uses: actions/checkout@v4 | |
| - name: Install Dependencies | |
| shell: bash | |
| run: | | |
| kustomize build --enable-helm components/kyverno/chainsaw | \ | |
| kubectl apply -f - --server-side | |
| - name: Install Cosign | |
| uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0 | |
| - name: Install Chainsaw | |
| uses: kyverno/action-install-chainsaw@f2b47b97dc889c12702113753d713f01ec268de5 # v0.2.12 | |
| with: | |
| verify: true | |
| - name: Wait for kyverno ready | |
| shell: bash | |
| run: | | |
| set -e | |
| kubectl rollout status deployment \ | |
| --namespace konflux-kyverno \ | |
| --selector '!job-name' \ | |
| --timeout=300s | |
| - name: Run chainsaw | |
| shell: bash | |
| run: | | |
| chainsaw test \ | |
| --config .chainsaw.yaml \ | |
| --no-color=false \ | |
| "${{ matrix.directory }}" |