-
-
Notifications
You must be signed in to change notification settings - Fork 50
109 lines (107 loc) · 2.86 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
on:
push:
branches: [ master ]
pull_request:
name: test and build
env:
GOPROXY: "https://proxy.golang.org"
CI_NO_PYTHON: "true"
jobs:
test:
strategy:
matrix:
go: [1.18.x, 1.17.x, 1.16.x, 1.15.x]
os: [ubuntu-latest, macos-latest, windows-latest]
tags: [avx, sse]
allowfail: [false]
include:
- go: tip
os: ubuntu-latest
allowfail: true
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.allowfail }}
timeout-minutes: 5
steps:
- name: Install Go ${{ matrix.go }} on ${{ matrix.os }}
if: matrix.go != 'tip'
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
# tempoary hack:
# https://github.com/actions/setup-go/issues/21#issuecomment-565704236
- name: Install Go ${{ matrix.go }} on ${{ matrix.os }}
if: matrix.go == 'tip'
run: |
git clone --depth=1 https://go.googlesource.com/go $HOME/gotip
cd $HOME/gotip/src
./make.bash
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
echo "$HOME/gotip/bin" >> $GITHUB_PATH
- name: Checkout code
uses: actions/checkout@v2
- name: Run tests
run: |
go test ./... -v -race
go test ./... -race -tags=${{ matrix.tags }}
coverage:
env:
CI_NO_PYTHON: "false"
PYTHON_COMMAND: python
strategy:
matrix:
tags: [avx, sse]
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.14.x
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
architecture: 'x64'
- name: Install Pip
uses: BSFishy/pip-action@v1
with:
packages: numpy
- name: Checkout code
uses: actions/checkout@v2
- name: Calc coverage
run: |
export PATH=$PATH:$(go env GOPATH)/bin
go test ./... -v -covermode=atomic -coverprofile=coverage.out
- name: Convert coverage to lcov
uses: jandelgado/[email protected]
with:
infile: coverage.out
outfile: coverage.lcov
- name: Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: coverage.lcov
build:
strategy:
matrix:
go: [1.13, 1.14]
goos: [linux, darwin]
goarch: [amd64, arm]
exclude:
# windows/386 and darwin/386 seems useless
- goarch: "arm"
goos: darwin
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Install Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Checkout code
uses: actions/checkout@v2
- name: build
run: go build .
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}