2022-08-27 13:05:22 +00:00
|
|
|
name: test
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
2022-09-20 19:16:13 +00:00
|
|
|
- '[0-9]+.[0-9]+'
|
2022-08-27 13:05:22 +00:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
env:
|
2024-02-14 11:56:06 +00:00
|
|
|
GO_VERSION: "1.21.7"
|
2022-08-27 13:05:22 +00:00
|
|
|
|
|
|
|
jobs:
|
2022-09-10 13:07:46 +00:00
|
|
|
validate-dco:
|
|
|
|
uses: ./.github/workflows/.dco.yml
|
|
|
|
|
2022-08-27 13:05:22 +00:00
|
|
|
build-dev:
|
|
|
|
runs-on: ubuntu-20.04
|
2022-09-10 13:07:46 +00:00
|
|
|
needs:
|
|
|
|
- validate-dco
|
2022-08-27 13:05:22 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
mode:
|
|
|
|
- ""
|
|
|
|
- systemd
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Prepare
|
|
|
|
run: |
|
|
|
|
if [ "${{ matrix.mode }}" = "systemd" ]; then
|
|
|
|
echo "SYSTEMD=true" >> $GITHUB_ENV
|
|
|
|
fi
|
|
|
|
-
|
|
|
|
name: Checkout
|
2024-01-30 12:28:43 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-08-27 13:05:22 +00:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2024-01-30 12:42:26 +00:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-08-27 13:05:22 +00:00
|
|
|
-
|
|
|
|
name: Build dev image
|
2024-01-30 12:45:04 +00:00
|
|
|
uses: docker/bake-action@v4
|
2022-08-27 13:05:22 +00:00
|
|
|
with:
|
|
|
|
targets: dev
|
|
|
|
set: |
|
|
|
|
*.cache-from=type=gha,scope=dev${{ matrix.mode }}
|
|
|
|
*.cache-to=type=gha,scope=dev${{ matrix.mode }},mode=max
|
|
|
|
*.output=type=cacheonly
|
|
|
|
|
2023-10-13 14:38:07 +00:00
|
|
|
test:
|
|
|
|
needs:
|
|
|
|
- build-dev
|
2024-01-18 10:16:57 +00:00
|
|
|
- validate-dco
|
2023-10-13 14:38:07 +00:00
|
|
|
uses: ./.github/workflows/.test.yml
|
2024-02-20 07:58:27 +00:00
|
|
|
secrets: inherit
|
2023-10-13 14:38:07 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-01-18 10:16:57 +00:00
|
|
|
storage:
|
|
|
|
- graphdriver
|
|
|
|
- snapshotter
|
2023-10-13 14:38:07 +00:00
|
|
|
with:
|
|
|
|
storage: ${{ matrix.storage }}
|
|
|
|
|
2022-09-10 13:10:44 +00:00
|
|
|
validate-prepare:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
needs:
|
|
|
|
- validate-dco
|
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.scripts.outputs.matrix }}
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2024-01-30 12:28:43 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-09-10 13:10:44 +00:00
|
|
|
-
|
|
|
|
name: Create matrix
|
|
|
|
id: scripts
|
|
|
|
run: |
|
2022-12-26 09:36:35 +00:00
|
|
|
scripts=$(cd ./hack/validate && jq -nc '$ARGS.positional - ["all", "default", "dco"] | map(select(test("[.]")|not)) + ["generate-files"]' --args *)
|
2022-11-10 17:39:47 +00:00
|
|
|
echo "matrix=$scripts" >> $GITHUB_OUTPUT
|
2022-09-10 13:10:44 +00:00
|
|
|
-
|
|
|
|
name: Show matrix
|
|
|
|
run: |
|
|
|
|
echo ${{ steps.scripts.outputs.matrix }}
|
|
|
|
|
2022-09-08 19:27:41 +00:00
|
|
|
validate:
|
|
|
|
runs-on: ubuntu-20.04
|
2023-04-11 13:22:57 +00:00
|
|
|
timeout-minutes: 120
|
2022-09-08 19:27:41 +00:00
|
|
|
needs:
|
2022-09-10 13:10:44 +00:00
|
|
|
- validate-prepare
|
2022-09-08 19:27:41 +00:00
|
|
|
- build-dev
|
|
|
|
strategy:
|
|
|
|
fail-fast: true
|
|
|
|
matrix:
|
2022-09-10 13:10:44 +00:00
|
|
|
script: ${{ fromJson(needs.validate-prepare.outputs.matrix) }}
|
2022-09-08 19:27:41 +00:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2024-01-30 12:28:43 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-09-08 19:27:41 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
-
|
|
|
|
name: Set up runner
|
|
|
|
uses: ./.github/actions/setup-runner
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2024-01-30 12:42:26 +00:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-09-08 19:27:41 +00:00
|
|
|
-
|
|
|
|
name: Build dev image
|
2024-01-30 12:45:04 +00:00
|
|
|
uses: docker/bake-action@v4
|
2022-09-08 19:27:41 +00:00
|
|
|
with:
|
|
|
|
targets: dev
|
|
|
|
set: |
|
|
|
|
dev.cache-from=type=gha,scope=dev
|
|
|
|
-
|
|
|
|
name: Validate
|
|
|
|
run: |
|
|
|
|
make -o build validate-${{ matrix.script }}
|
|
|
|
|
2023-10-13 14:38:07 +00:00
|
|
|
smoke-prepare:
|
2023-01-18 10:40:37 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
needs:
|
|
|
|
- validate-dco
|
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.platforms.outputs.matrix }}
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2024-01-30 12:28:43 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-01-18 10:40:37 +00:00
|
|
|
-
|
|
|
|
name: Create matrix
|
|
|
|
id: platforms
|
|
|
|
run: |
|
|
|
|
matrix="$(docker buildx bake binary-smoketest --print | jq -cr '.target."binary-smoketest".platforms')"
|
|
|
|
echo "matrix=$matrix" >> $GITHUB_OUTPUT
|
|
|
|
-
|
|
|
|
name: Show matrix
|
|
|
|
run: |
|
|
|
|
echo ${{ steps.platforms.outputs.matrix }}
|
|
|
|
|
|
|
|
smoke:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
needs:
|
2023-10-13 14:38:07 +00:00
|
|
|
- smoke-prepare
|
2023-01-18 10:40:37 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-10-13 14:38:07 +00:00
|
|
|
platform: ${{ fromJson(needs.smoke-prepare.outputs.matrix) }}
|
2023-01-18 10:40:37 +00:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2024-01-30 12:28:43 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-01-18 10:40:37 +00:00
|
|
|
-
|
|
|
|
name: Prepare
|
|
|
|
run: |
|
|
|
|
platform=${{ matrix.platform }}
|
|
|
|
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2024-01-30 12:55:28 +00:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2023-01-18 10:40:37 +00:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2024-01-30 12:42:26 +00:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-01-18 10:40:37 +00:00
|
|
|
-
|
|
|
|
name: Test
|
2024-01-30 12:45:04 +00:00
|
|
|
uses: docker/bake-action@v4
|
2023-01-18 10:40:37 +00:00
|
|
|
with:
|
|
|
|
targets: binary-smoketest
|
|
|
|
set: |
|
|
|
|
*.platform=${{ matrix.platform }}
|