-
-
Notifications
You must be signed in to change notification settings - Fork 54
67 lines (58 loc) · 1.65 KB
/
go.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Go
on:
push:
branches:
- v2
pull_request:
types: [opened, synchronize]
paths:
- '**.go'
- 'go.mod'
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- name: Remove symlink 2to3
if: matrix.os == 'macos-latest'
run: |
: # Workaround GitHub Actions Python issues
: # https://github.com/Homebrew/homebrew-core/issues/165793#issuecomment-1989441193
brew unlink python && brew link --overwrite python
- name: Set up Graphviz
uses: ts-graphviz/setup-graphviz@v2
- name: Build
run: go build -v ./...
- name: Test
run: |
go test -v ./...
cd tokenizer; go test -benchmem -bench .; cd ..
coverage:
needs: test
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- name: Install goveralls
run: go install github.com/mattn/goveralls@latest
- name: Coverage
run: |
go test -v -coverprofile=profile.cov -covermode=atomic ./...
goveralls -coverprofile=profile.cov -service=github
env:
COVERALLS_TOKEN: ${{ github.token }}