From 2823c29ec7874de0919c86440c5573c66e4887b4 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Mon, 12 Sep 2022 13:06:27 +0200 Subject: [PATCH] build(ci): updated test workflow --- .github/workflows/test.yml | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c1c55dd1..d0c44fb7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,21 +14,39 @@ jobs: - uses: rokroskar/workflow-run-cleanup-action@master env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - if: "!startsWith(github.ref, 'refs/tags/') && !startsWith(github.ref, 'refs/tags/cosmos')" + if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'" Unit-tests: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - name: Checkout + - name: Checkout ๐Ÿ›Ž๏ธ uses: actions/checkout@v3 - - name: Setup Go + + - name: Setup Go ๐Ÿงฐ uses: actions/setup-go@v3 with: go-version: 1.18 - - name: Test & Create coverage report - run: make install test-unit - - name: Upload cove coverage - uses: codecov/codecov-action@v1.0.14 + + - name: Compute diff ๐Ÿ“œ + uses: technote-space/get-diff-action@v6.1.0 + id: git_diff + with: + PATTERNS: | + **/**.go + go.mod + go.sum + + - name: Build ๐Ÿ”จ + if: "env.GIT_DIFF != ''" + run: GOARCH=${{ matrix.go-arch }} LEDGER_ENABLED=false make build + + - name: Test & Coverage report creation ๐Ÿงช + run: | + make install test-unit stop-docker-test + + - name: Upload coverage ๐Ÿ“ค + if: "env.GIT_DIFF != ''" + uses: codecov/codecov-action@v3 with: file: ./coverage.txt