mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-23 12:17:45 +08:00
ci: merge test workflow to build one
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
17bdbbd3c3
commit
e762e46b4b
58
.github/workflows/build.yml
vendored
58
.github/workflows/build.yml
vendored
@ -27,10 +27,34 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
env:
|
||||||
|
TESTFLAGS: "-v --parallel=6 --timeout=30m"
|
||||||
|
TESTFLAGS_DOCKER: "-v --parallel=1 --timeout=30m"
|
||||||
|
GOTESTSUM_FORMAT: "standard-verbose"
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
worker:
|
||||||
|
- docker
|
||||||
|
- docker-container
|
||||||
|
- remote
|
||||||
|
pkg:
|
||||||
|
- ./tests
|
||||||
|
typ:
|
||||||
|
- integration
|
||||||
|
include:
|
||||||
|
- pkg: ./...
|
||||||
|
skip-integration-tests: 1
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
-
|
||||||
|
name: Expose GitHub Runtime
|
||||||
|
uses: crazy-max/ghaction-github-runtime@v2
|
||||||
|
-
|
||||||
|
name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
@ -40,19 +64,29 @@ jobs:
|
|||||||
buildkitd-flags: --debug
|
buildkitd-flags: --debug
|
||||||
-
|
-
|
||||||
name: Test
|
name: Test
|
||||||
uses: docker/bake-action@v3
|
run: |
|
||||||
with:
|
export TEST_REPORT_SUFFIX=-${{ github.job }}-$(echo "${{ matrix.pkg }}-${{ matrix.skip-integration-tests }}-${{ matrix.worker }}" | tr -dc '[:alnum:]-\n\r' | tr '[:upper:]' '[:lower:]')
|
||||||
targets: test
|
./hack/test ${{ matrix.typ }}
|
||||||
set: |
|
env:
|
||||||
*.cache-from=type=gha,scope=test
|
TEST_DOCKERD: "${{ (matrix.worker == 'docker' || matrix.worker == 'docker-container') && '1' || '0' }}"
|
||||||
*.cache-to=type=gha,scope=test
|
TESTFLAGS: "${{ (matrix.worker == 'docker' || matrix.worker == 'docker-container') && env.TESTFLAGS_DOCKER || env.TESTFLAGS }} --run=//worker=${{ matrix.worker }}$"
|
||||||
|
TESTPKGS: "${{ matrix.pkg }}"
|
||||||
|
SKIP_INTEGRATION_TESTS: "${{ matrix.skip-integration-tests }}"
|
||||||
-
|
-
|
||||||
name: Upload coverage
|
name: Generate annotations
|
||||||
uses: codecov/codecov-action@v3
|
if: always()
|
||||||
|
uses: crazy-max/.github/.github/actions/gotest-annotations@1a64ea6d01db9a48aa61954cb20e265782c167d9
|
||||||
with:
|
with:
|
||||||
directory: ${{ env.DESTDIR }}/coverage
|
directory: ./bin/testreports
|
||||||
|
-
|
||||||
|
name: Upload test reports
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: test-reports
|
||||||
|
path: ./bin/testreports
|
||||||
|
|
||||||
prepare:
|
prepare-binaries:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.platforms.outputs.matrix }}
|
matrix: ${{ steps.platforms.outputs.matrix }}
|
||||||
@ -73,11 +107,11 @@ jobs:
|
|||||||
binaries:
|
binaries:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs:
|
needs:
|
||||||
- prepare
|
- prepare-binaries
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
platform: ${{ fromJson(needs.prepare.outputs.matrix) }}
|
platform: ${{ fromJson(needs.prepare-binaries.outputs.matrix) }}
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Prepare
|
name: Prepare
|
||||||
|
81
.github/workflows/test.yml
vendored
81
.github/workflows/test.yml
vendored
@ -1,81 +0,0 @@
|
|||||||
name: test
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
- 'v[0-9]*'
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
pull_request:
|
|
||||||
paths-ignore:
|
|
||||||
- '.github/releases.json'
|
|
||||||
- 'README.md'
|
|
||||||
- 'docs/**'
|
|
||||||
|
|
||||||
env:
|
|
||||||
SETUP_BUILDX_VERSION: "latest"
|
|
||||||
SETUP_BUILDKIT_IMAGE: "moby/buildkit:latest"
|
|
||||||
TESTFLAGS: "-v --parallel=6 --timeout=30m"
|
|
||||||
TESTFLAGS_DOCKER: "-v --parallel=1 --timeout=30m"
|
|
||||||
GOTESTSUM_FORMAT: "standard-verbose"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
worker:
|
|
||||||
- docker
|
|
||||||
- docker-container
|
|
||||||
- remote
|
|
||||||
pkg:
|
|
||||||
- ./tests
|
|
||||||
typ:
|
|
||||||
- integration
|
|
||||||
# already run as part of build.yml
|
|
||||||
# include:
|
|
||||||
# - pkg: ./...
|
|
||||||
# skip-integration-tests: 1
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
-
|
|
||||||
name: Expose GitHub Runtime
|
|
||||||
uses: crazy-max/ghaction-github-runtime@v2
|
|
||||||
-
|
|
||||||
name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v2
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
with:
|
|
||||||
version: ${{ env.SETUP_BUILDX_VERSION }}
|
|
||||||
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
|
|
||||||
buildkitd-flags: --debug
|
|
||||||
-
|
|
||||||
name: Test
|
|
||||||
run: |
|
|
||||||
export TEST_REPORT_SUFFIX=-${{ github.job }}-$(echo "${{ matrix.pkg }}-${{ matrix.skip-integration-tests }}-${{ matrix.worker }}" | tr -dc '[:alnum:]-\n\r' | tr '[:upper:]' '[:lower:]')
|
|
||||||
./hack/test ${{ matrix.typ }}
|
|
||||||
env:
|
|
||||||
TEST_DOCKERD: "${{ (matrix.worker == 'docker' || matrix.worker == 'docker-container') && '1' || '0' }}"
|
|
||||||
TESTFLAGS: "${{ (matrix.worker == 'docker' || matrix.worker == 'docker-container') && env.TESTFLAGS_DOCKER || env.TESTFLAGS }} --run=//worker=${{ matrix.worker }}$"
|
|
||||||
TESTPKGS: "${{ matrix.pkg }}"
|
|
||||||
SKIP_INTEGRATION_TESTS: "${{ matrix.skip-integration-tests }}"
|
|
||||||
-
|
|
||||||
name: Generate annotations
|
|
||||||
if: always()
|
|
||||||
uses: crazy-max/.github/.github/actions/gotest-annotations@1a64ea6d01db9a48aa61954cb20e265782c167d9
|
|
||||||
with:
|
|
||||||
directory: ./bin/testreports
|
|
||||||
-
|
|
||||||
name: Upload test reports
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: test-reports
|
|
||||||
path: ./bin/testreports
|
|
Loading…
x
Reference in New Issue
Block a user