File tree Expand file tree Collapse file tree 2 files changed +16
-15
lines changed
Expand file tree Collapse file tree 2 files changed +16
-15
lines changed Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - main
7- tags :
8- - " v[0-9]+.[0-9]+.[0-9]+*"
97 pull_request :
108 branches :
119 - main
@@ -15,17 +13,15 @@ concurrency:
1513 cancel-in-progress : true
1614
1715jobs :
18- build-and-test :
16+ common-steps :
1917 runs-on : ubuntu-latest
18+ outputs :
19+ common-dependencies : ${{ steps.common-steps.outputs.deps }}
2020 permissions :
2121 contents : write # needed to push coverage to gh-pages
2222 pull-requests : write # needed to comment on PRs
2323
24- strategy :
25- matrix :
26- go-version : ["1.24.5"]
27- fail-fast : false
28-
24+ write-all : true # necessary for release creation and publishing
2925 steps :
3026 - name : Checkout code
3127 uses : actions/checkout@v5
5349 go mod tidy
5450 make deps
5551
56- - name : Check code formatting
57- run : make fmt
52+ build-and-test :
53+ needs : common-steps
54+ runs-on : ubuntu-latest
55+ strategy :
56+ matrix :
57+ go-version : ["1.24.5"]
58+ fail-fast : false
5859
60+ steps :
5961 - name : Run unit tests
6062 run : make test
6163
7678 ./scripts/publishCoverage.sh
7779
7880 release :
79- needs : build-and-test
80- permissions : write-all
81+ needs : common-steps
8182 runs-on : ubuntu-latest
8283
8384 strategy :
Original file line number Diff line number Diff line change @@ -87,11 +87,11 @@ curl -s "https://img.shields.io/badge/coverage-${NEW_COVERAGE}%25-${BADGE_COLOR}
8787
8888# Result message
8989if (( $(echo "$OLD_COVERAGE > $NEW_COVERAGE " | bc - l) )) ; then
90- RESULT_MESSAGE=" Coverage decreased from ** $OLD_COVERAGE %** → ** $NEW_COVERAGE %** "
90+ RESULT_MESSAGE=" :red_circle: Coverage decreased from $OLD_COVERAGE % to $NEW_COVERAGE %"
9191elif (( $(echo "$OLD_COVERAGE == $NEW_COVERAGE " | bc - l) )) ; then
92- RESULT_MESSAGE=" Coverage remained the same at ** $NEW_COVERAGE %** "
92+ RESULT_MESSAGE=" :thumbsup: Coverage remained same at $NEW_COVERAGE %"
9393else
94- RESULT_MESSAGE=" Coverage increased from ** $OLD_COVERAGE %** → ** $NEW_COVERAGE %** "
94+ RESULT_MESSAGE=" :thumbsup: Coverage increased from $OLD_COVERAGE % to $NEW_COVERAGE %"
9595fi
9696
9797# Push to gh-pages (only on push)
You can’t perform that action at this time.
0 commit comments