-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (34 loc) · 1 KB
/
ci-run.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: run
on:
push:
branches:
tags:
pull_request:
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up go 1.20
uses: actions/setup-go@v3
with:
go-version: "1.20"
- name: build and test
run: go test -race -timeout=60s -covermode=atomic -coverprofile=$GITHUB_WORKSPACE/profile.cov ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.58
- name: install goveralls
run: go install github.com/mattn/goveralls@latest
- name: submit coverage
run: |
export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
export GIT_TAG="${GITHUB_REF/refs\/tags\//}"
if [[ "$GIT_TAG" != "$GITHUB_REF" ]]; then
export GIT_BRANCH=$GIT_TAG
fi
echo "coverage for branch $GIT_BRANCH"
goveralls -service="GitHub Action" -coverprofile=$GITHUB_WORKSPACE/profile.cov
env:
COVERALLS_TOKEN: ${{secrets.COVERALLS_TOKEN}}