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:
parent
e42f7db450
commit
cc770330f8
1 changed files with 23 additions and 13 deletions
36
.github/workflows/test.yml
vendored
36
.github/workflows/test.yml
vendored
|
@ -55,26 +55,36 @@ jobs:
|
|||
*.cache-to=type=gha,scope=dev${{ matrix.mode }},mode=max
|
||||
*.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:
|
||||
runs-on: ubuntu-20.04
|
||||
needs:
|
||||
- validate-prepare
|
||||
- build-dev
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
script:
|
||||
- dco
|
||||
- default-seccomp
|
||||
- pkg-imports
|
||||
- yamllint
|
||||
- swagger
|
||||
- swagger-gen
|
||||
- toml
|
||||
- changelog-well-formed
|
||||
- changelog-date-descending
|
||||
- golangci-lint
|
||||
- shfmt
|
||||
- vendor
|
||||
script: ${{ fromJson(needs.validate-prepare.outputs.matrix) }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
|
|
Loading…
Reference in a new issue