|
@@ -55,10 +55,75 @@ jobs:
|
|
|
*.cache-to=type=gha,scope=dev${{ matrix.mode }},mode=max
|
|
|
*.output=type=cacheonly
|
|
|
|
|
|
+ validate:
|
|
|
+ runs-on: ubuntu-20.04
|
|
|
+ needs:
|
|
|
+ - 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
|
|
|
+ steps:
|
|
|
+ -
|
|
|
+ name: Checkout
|
|
|
+ uses: actions/checkout@v3
|
|
|
+ with:
|
|
|
+ fetch-depth: 0
|
|
|
+ -
|
|
|
+ name: Dump context
|
|
|
+ uses: actions/github-script@v6
|
|
|
+ with:
|
|
|
+ script: |
|
|
|
+ console.log(JSON.stringify(context, null, 2));
|
|
|
+ -
|
|
|
+ name: Get base ref
|
|
|
+ id: base-ref
|
|
|
+ uses: actions/github-script@v6
|
|
|
+ with:
|
|
|
+ result-encoding: string
|
|
|
+ script: |
|
|
|
+ if (/^refs\/pull\//.test(context.ref) && context.payload?.pull_request?.base?.ref != undefined) {
|
|
|
+ return context.payload.pull_request.base.ref;
|
|
|
+ }
|
|
|
+ return context.ref.replace(/^refs\/heads\//g, '');
|
|
|
+ -
|
|
|
+ name: Set up runner
|
|
|
+ uses: ./.github/actions/setup-runner
|
|
|
+ -
|
|
|
+ name: Set up Docker Buildx
|
|
|
+ uses: docker/setup-buildx-action@v2
|
|
|
+ -
|
|
|
+ name: Build dev image
|
|
|
+ uses: docker/bake-action@v2
|
|
|
+ with:
|
|
|
+ targets: dev
|
|
|
+ set: |
|
|
|
+ dev.cache-from=type=gha,scope=dev
|
|
|
+ -
|
|
|
+ name: Validate
|
|
|
+ run: |
|
|
|
+ make -o build validate-${{ matrix.script }}
|
|
|
+ env:
|
|
|
+ VALIDATE_REPO: ${{ github.server_url }}/${{ github.repository }}.git
|
|
|
+ VALIDATE_BRANCH: ${{ steps.base-ref.outputs.result }}
|
|
|
+
|
|
|
unit:
|
|
|
runs-on: ubuntu-20.04
|
|
|
needs:
|
|
|
- build-dev
|
|
|
+ - validate
|
|
|
steps:
|
|
|
-
|
|
|
name: Checkout
|
|
@@ -108,6 +173,7 @@ jobs:
|
|
|
runs-on: ubuntu-20.04
|
|
|
needs:
|
|
|
- build-dev
|
|
|
+ - validate
|
|
|
steps:
|
|
|
-
|
|
|
name: Checkout
|
|
@@ -155,6 +221,7 @@ jobs:
|
|
|
runs-on: ubuntu-20.04
|
|
|
needs:
|
|
|
- build-dev
|
|
|
+ - validate
|
|
|
steps:
|
|
|
-
|
|
|
name: Checkout
|
|
@@ -183,6 +250,7 @@ jobs:
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
needs:
|
|
|
- build-dev
|
|
|
+ - validate
|
|
|
strategy:
|
|
|
fail-fast: false
|
|
|
matrix:
|
|
@@ -299,6 +367,7 @@ jobs:
|
|
|
runs-on: ubuntu-20.04
|
|
|
needs:
|
|
|
- build-dev
|
|
|
+ - validate
|
|
|
- integration-cli-prepare
|
|
|
strategy:
|
|
|
fail-fast: false
|