From 4f393ed0fd844bbe7919c10c10a69ef2a4ba3a44 Mon Sep 17 00:00:00 2001 From: Timur Zununbekov Date: Thu, 15 Feb 2024 18:44:33 +0600 Subject: [PATCH] Build platforms matrix --- .github/workflows/build-and-release.yml | 57 ++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index cca49af83e..7d6f83142d 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -1,11 +1,20 @@ name: Test and build -on: [pull_request] +on: + push: + branches: + - master + - ci-migration + tags: + - 'v*' + pull_request: env: GOFLAGS: "-count=1" + RELEASE_BUILD: false + SNAPSHOT_BUILD: false jobs: - test-and-build: + unit-tests: runs-on: ubuntu-latest environment: production @@ -31,6 +40,17 @@ jobs: file: ./coverage.txt token: ${{ secrets.CODECOV_TOKEN }} + e2e-tests: + runs-on: ubuntu-latest + environment: production + + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.21.x' + - name: Login to Docker Hub uses: docker/login-action@v3 with: @@ -42,3 +62,36 @@ jobs: - name: E2E NAT test run: go run mage.go -v TestE2ENAT + + build: + if: github.event_name != 'pull_request' + runs-on: ubuntu-latest + environment: production + needs: e2e-tests + + strategy: + max-parallel: 3 + matrix: + platform: + - PackageLinuxAmd64 + - PackageLinuxArm + - PackageLinuxDebianAmd64 + - PackageLinuxDebianArm64 + - PackageLinuxDebianArm + - PackageLinuxRaspberryImage + - PackageMacOSAmd64 + - PackageMacOSArm64 + - PackageWindowsAmd64 + - PackageAndroid + - PackageAndroidProvider + - PackageDockerSwaggerRedoc + + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.21.x' + + - name: Build package + run: go run mage.go -v ${{ matrix.platform }}