good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 9b9d7b4a authored by Anmol Sethi's avatar Anmol Sethi
Browse files

Cleanup coveralls setup

parent b0ac42c3
No related branches found
No related tags found
No related merge requests found
name: ci name: ci
on: [push] on: [push, pull_request]
jobs: jobs:
fmt: fmt:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: nhooyr/websocket-ci@sha256:046cd02e79dcbf81dc06eb6fd333fa8643f2503f437ddd46a4c1af9132078a2c container: nhooyr/websocket-ci@sha256:8a8fd73fdea33585d50a33619c4936adfd016246a2ed6bbfbf06def24b518a6a
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- run: make fmt - run: make fmt
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: nhooyr/websocket-ci@sha256:046cd02e79dcbf81dc06eb6fd333fa8643f2503f437ddd46a4c1af9132078a2c container: nhooyr/websocket-ci@sha256:8a8fd73fdea33585d50a33619c4936adfd016246a2ed6bbfbf06def24b518a6a
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- run: make lint - run: make lint
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: nhooyr/websocket-ci@sha256:046cd02e79dcbf81dc06eb6fd333fa8643f2503f437ddd46a4c1af9132078a2c container: nhooyr/websocket-ci@sha256:8a8fd73fdea33585d50a33619c4936adfd016246a2ed6bbfbf06def24b518a6a
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- run: make test - run: make test
env: env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} COVERALLS_TOKEN: ${{ secrets.github_token }}
- name: Upload coverage.html - name: Upload coverage.html
uses: actions/upload-artifact@master uses: actions/upload-artifact@master
with: with:
......
...@@ -3,6 +3,7 @@ FROM golang:1 ...@@ -3,6 +3,7 @@ FROM golang:1
RUN apt-get update RUN apt-get update
RUN apt-get install -y chromium RUN apt-get install -y chromium
RUN apt-get install -y npm RUN apt-get install -y npm
RUN apt-get install -y jq
ENV GOPATH=/root/gopath ENV GOPATH=/root/gopath
ENV PATH=$GOPATH/bin:$PATH ENV PATH=$GOPATH/bin:$PATH
......
...@@ -7,11 +7,15 @@ ci/out/coverage.html: gotest ...@@ -7,11 +7,15 @@ ci/out/coverage.html: gotest
go tool cover -html=ci/out/coverage.prof -o=ci/out/coverage.html go tool cover -html=ci/out/coverage.prof -o=ci/out/coverage.html
coveralls: gotest coveralls: gotest
# https://github.com/coverallsapp/github-action/blob/master/src/run.ts
echo "--- coveralls" echo "--- coveralls"
export GIT_BRANCH=$${GITHUB_REF} export GIT_BRANCH="$$GITHUB_REF"
export BUILD_NUMBER=$${GITHUB_ACTION} export BUILD_NUMBER="$$GITHUB_SHA"
goveralls -coverprofile=ci/out/coverage.prof -service=github-actions if [[ $$GITHUB_EVENT_NAME == pull_request ]]; then
export CI_PULL_REQUEST="$$(jq .number "$$GITHUB_EVENT_PATH")"
BUILD_NUMBER="$$BUILD_NUMBER-PR-$$CI_PULL_REQUEST"
fi
goveralls -coverprofile=ci/out/coverage.prof -service=github
gotest: gotest:
go test -covermode=count -coverprofile=ci/out/coverage.prof -coverpkg=./... $${GOTESTFLAGS-} ./... go test -covermode=count -coverprofile=ci/out/coverage.prof -coverpkg=./... $${GOTESTFLAGS-} ./...
sed -i '/_stringer\.go/d' ci/out/coverage.prof sed -i '/_stringer\.go/d' ci/out/coverage.prof
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment