File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 11name : ci
2- on : [push]
2+ on : [push, pull_request ]
33
44jobs :
55 fmt :
66 runs-on : ubuntu-latest
7- container : nhooyr/websocket-ci@sha256:046cd02e79dcbf81dc06eb6fd333fa8643f2503f437ddd46a4c1af9132078a2c
7+ container : nhooyr/websocket-ci@sha256:8a8fd73fdea33585d50a33619c4936adfd016246a2ed6bbfbf06def24b518a6a
88 steps :
99 - uses : actions/checkout@v1
1010 - run : make fmt
1111 lint :
1212 runs-on : ubuntu-latest
13- container : nhooyr/websocket-ci@sha256:046cd02e79dcbf81dc06eb6fd333fa8643f2503f437ddd46a4c1af9132078a2c
13+ container : nhooyr/websocket-ci@sha256:8a8fd73fdea33585d50a33619c4936adfd016246a2ed6bbfbf06def24b518a6a
1414 steps :
1515 - uses : actions/checkout@v1
1616 - run : make lint
1717 test :
1818 runs-on : ubuntu-latest
19- container : nhooyr/websocket-ci@sha256:046cd02e79dcbf81dc06eb6fd333fa8643f2503f437ddd46a4c1af9132078a2c
19+ container : nhooyr/websocket-ci@sha256:8a8fd73fdea33585d50a33619c4936adfd016246a2ed6bbfbf06def24b518a6a
2020 steps :
2121 - uses : actions/checkout@v1
2222 - run : make test
2323 env :
24- COVERALLS_TOKEN : ${{ secrets.COVERALLS_TOKEN }}
24+ COVERALLS_TOKEN : ${{ secrets.github_token }}
2525 - name : Upload coverage.html
2626 uses : actions/upload-artifact@master
2727 with :
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ FROM golang:1
33RUN apt-get update
44RUN apt-get install -y chromium
55RUN apt-get install -y npm
6+ RUN apt-get install -y jq
67
78ENV GOPATH=/root/gopath
89ENV PATH=$GOPATH/bin:$PATH
Original file line number Diff line number Diff line change @@ -7,11 +7,15 @@ ci/out/coverage.html: gotest
77 go tool cover -html=ci/out/coverage.prof -o=ci/out/coverage.html
88
99coveralls : gotest
10+ # https://github.com/coverallsapp/github-action/blob/master/src/run.ts
1011 echo " --- coveralls"
11- export GIT_BRANCH=$$ {GITHUB_REF}
12- export BUILD_NUMBER=$$ {GITHUB_ACTION}
13- goveralls -coverprofile=ci/out/coverage.prof -service=github-actions
14-
12+ export GIT_BRANCH=" $$ GITHUB_REF"
13+ export BUILD_NUMBER=" $$ GITHUB_SHA"
14+ if [[ $$ GITHUB_EVENT_NAME == pull_request ]]; then
15+ export CI_PULL_REQUEST=" $$ (jq .number " $$ GITHUB_EVENT_PATH" )"
16+ BUILD_NUMBER=" $$ BUILD_NUMBER-PR-$$ CI_PULL_REQUEST"
17+ fi
18+ goveralls -coverprofile=ci/out/coverage.prof -service=github
1519gotest :
1620 go test -covermode=count -coverprofile=ci/out/coverage.prof -coverpkg=./... $$ {GOTESTFLAGS-} ./...
1721 sed -i ' /_stringer\.go/d' ci/out/coverage.prof
You can’t perform that action at this time.
0 commit comments