ci(test): dynamic validate matrix

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 5a98363a92)
This commit is contained in:
CrazyMax 2022-09-10 15:10:44 +02:00
parent e42f7db450
commit cc770330f8
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7

View file

@ -55,26 +55,36 @@ jobs:
*.cache-to=type=gha,scope=dev${{ matrix.mode }},mode=max *.cache-to=type=gha,scope=dev${{ matrix.mode }},mode=max
*.output=type=cacheonly *.output=type=cacheonly
validate-prepare:
runs-on: ubuntu-20.04
needs:
- validate-dco
outputs:
matrix: ${{ steps.scripts.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Create matrix
id: scripts
run: |
scripts=$(jq -ncR '[inputs]' <<< "$(ls -I .validate -I all -I default -I dco -I golangci-lint.yml -I yamllint.yaml -A ./hack/validate/)")
echo "::set-output name=matrix::$scripts"
-
name: Show matrix
run: |
echo ${{ steps.scripts.outputs.matrix }}
validate: validate:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
needs: needs:
- validate-prepare
- build-dev - build-dev
strategy: strategy:
fail-fast: true fail-fast: true
matrix: matrix:
script: script: ${{ fromJson(needs.validate-prepare.outputs.matrix) }}
- dco
- default-seccomp
- pkg-imports
- yamllint
- swagger
- swagger-gen
- toml
- changelog-well-formed
- changelog-date-descending
- golangci-lint
- shfmt
- vendor
steps: steps:
- -
name: Checkout name: Checkout