Skip to content

Commit 62b8c3c

Browse files
authored
chore: run the unit tests and report on the master branch (#13)
Co-authored-by: rick <[email protected]>
1 parent e4d871d commit 62b8c3c

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

.github/workflows/release.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,28 @@ env:
1313
IMAGE_NAME: ${{ github.repository }}
1414

1515
jobs:
16+
Test:
17+
runs-on: ubuntu-20.04
18+
steps:
19+
- name: Set up Go
20+
uses: actions/setup-go@v3
21+
with:
22+
go-version: 1.22.x
23+
- uses: actions/[email protected]
24+
- name: Unit Test
25+
run: |
26+
make test
27+
- name: Report
28+
if: github.actor == 'linuxsuren'
29+
env:
30+
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
31+
run: |
32+
bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial --force-coverage-parser go -r coverage.out
33+
bash <(curl -Ls https://coverage.codacy.com/get.sh) final
34+
1635
goreleaser:
1736
runs-on: ubuntu-20.04
37+
if: github.ref != 'refs/heads/master'
1838
steps:
1939
- name: Checkout
2040
uses: actions/[email protected]
@@ -29,7 +49,6 @@ jobs:
2949
with:
3050
go-version: 1.22.x
3151
- name: Image Registry Login
32-
if: github.ref != 'refs/heads/master'
3352
run: |
3453
docker login --username linuxsuren --password ${{secrets.DOCKER_HUB_PUBLISH_SECRETS}}
3554
docker login ${{ env.REGISTRY }}/linuxsuren --username linuxsuren --password ${{secrets.GH_PUBLISH_SECRETS}}
@@ -41,7 +60,6 @@ jobs:
4160
env:
4261
GITHUB_TOKEN: ${{ secrets.GH_PUBLISH_SECRETS }}
4362
- name: Upload via oras
44-
if: github.ref != 'refs/heads/master'
4563
run: |
4664
export TAG=${{ steps.vars.outputs.tag }}
4765
cd dist

0 commit comments

Comments
 (0)