From 6dee15cebba64e2fe329bc99719986ff9ff1e318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20N=C3=A9au?= Date: Mon, 19 Feb 2024 15:21:44 +0100 Subject: [PATCH] Add validation and testing steps This adds linting, code generation, dependencies validation and unit + integration tests prior to producing a new release. --- .github/workflows/release-fleet.yml | 35 ++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-fleet.yml b/.github/workflows/release-fleet.yml index 0b5e403ead..7b40fa6b20 100644 --- a/.github/workflows/release-fleet.yml +++ b/.github/workflows/release-fleet.yml @@ -40,11 +40,13 @@ jobs: go-version-file: 'go.mod' check-latest: true - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v4.0.0 + with: + # Required: the version of golangci-lint is required and must be specified without patch version: we always + # use the latest patch version. + version: v1.55 + args: --timeout=10m --config=.golangci.json # - name: Run FOSSA scan # uses: fossas/fossa-action@v1.3.1 @@ -57,6 +59,29 @@ jobs: # api-key: ${{ secrets.FOSSA_API_KEY }} # run-tests: true + - name: Build Fleet binaries + run: ./.github/scripts/build-fleet-binaries.sh + + - name: Check for code changes + run: | + ./.github/scripts/check-for-auto-generated-changes.sh + go mod verify + + - name: Run unit tests + run: go test -cover -tags=test $(go list ./... | grep -v -e /e2e -e /integrationtests) + + - name: Run integration tests + env: + SETUP_ENVTEST_VER: v0.0.0-20240115093953-9e6e3b144a69 + ENVTEST_K8S_VERSION: 1.28 + run: ./.github/scripts/run-integration-tests.sh + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log into Container registry uses: docker/login-action@v3 with: