From 6024212ac83cf9e5946c35ad88781b832d430857 Mon Sep 17 00:00:00 2001 From: Justin Chadwell Date: Wed, 3 May 2023 10:27:43 +0100 Subject: [PATCH] ci: add integration tests Signed-off-by: Justin Chadwell --- .github/workflows/test.yml | 81 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..dad6f7d1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,81 @@ +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