-
Notifications
You must be signed in to change notification settings - Fork 45
32 lines (32 loc) · 1.08 KB
/
test.yaml
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
name: Test
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.17", "1.18"]
name: Test on Go ${{ matrix.go }}
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- run: go version
- name: Setup Chrome
uses: browser-actions/setup-chrome@latest
- run: chrome --version
- name: Run tests
run: |
chrome --headless --disable-gpu --remote-debugging-port=9222 --disable-setuid-sandbox --no-sandbox about:blank &
chrome_pid=$!
go list -f '{{if len .TestGoFiles}}-coverprofile={{.Name}}_coverage.out {{.ImportPath}}{{end}}' ./... | xargs -L1 go test -race -covermode=atomic
go test ./session -browser -race -covermode=atomic -coverprofile=session_coverage.out
go test . -browser
kill -9 $chrome_pid
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
verbose: true