Debian Codegraph @

.github/workflows/.go.yml

raw
1 on:
2 push:
3 branches: [ master ]
4 pull_request:
5 name: test and build
6 env:
7 GOPROXY: "https://proxy.golang.org"
8 CI_NO_PYTHON: "true"
9 jobs:
10 test:
11 strategy:
12 matrix:
13 go: [1.18.x, 1.17.x, 1.16.x, 1.15.x]
14 os: [ubuntu-latest, macos-latest, windows-latest]
15 tags: [avx, sse]
16 allowfail: [false]
17 include:
18 - go: tip
19 os: ubuntu-latest
20 allowfail: true
21 runs-on: ${{ matrix.os }}
22 continue-on-error: ${{ matrix.allowfail }}
23 timeout-minutes: 5
24 steps:
25 - name: Install Go ${{ matrix.go }} on ${{ matrix.os }}
26 if: matrix.go != 'tip'
27 uses: actions/setup-go@v2
28 with:
29 go-version: ${{ matrix.go }}
30 # tempoary hack:
31 # https://github.com/actions/setup-go/issues/21#issuecomment-565704236
32 - name: Install Go ${{ matrix.go }} on ${{ matrix.os }}
33 if: matrix.go == 'tip'
34 run: |
35 git clone --depth=1 https://go.googlesource.com/go $HOME/gotip
36 cd $HOME/gotip/src
37 ./make.bash
38 echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
39 echo "$HOME/gotip/bin" >> $GITHUB_PATH
40 - name: Checkout code
41 uses: actions/checkout@v2
42 - name: Run tests
43 run: |
44 go test ./... -v -race
45 go test ./... -race -tags=${{ matrix.tags }}
46
47 coverage:
48 env:
49 CI_NO_PYTHON: "false"
50 PYTHON_COMMAND: python
51 strategy:
52 matrix:
53 tags: [avx, sse]
54 runs-on: ubuntu-latest
55 steps:
56 - name: Install Go
57 uses: actions/setup-go@v2
58 with:
59 go-version: 1.14.x
60 - name: Install Python
61 uses: actions/setup-python@v2
62 with:
63 python-version: '3.x'
64 architecture: 'x64'
65 - name: Install Pip
66 uses: BSFishy/pip-action@v1
67 with:
68 packages: numpy
69 - name: Checkout code
70 uses: actions/checkout@v2
71 - name: Calc coverage
72 run: |
73 export PATH=$PATH:$(go env GOPATH)/bin
74 go test ./... -v -covermode=atomic -coverprofile=coverage.out
75 - name: Convert coverage to lcov
76 uses: jandelgado/[email protected]
77 with:
78 infile: coverage.out
79 outfile: coverage.lcov
80 - name: Coveralls
81 uses: coverallsapp/[email protected]
82 with:
83 github-token: ${{ secrets.github_token }}
84 path-to-lcov: coverage.lcov
85
86 build:
87 strategy:
88 matrix:
89 go: [1.13, 1.14]
90 goos: [linux, darwin]
91 goarch: [amd64, arm]
92 exclude:
93 # windows/386 and darwin/386 seems useless
94 - goarch: "arm"
95 goos: darwin
96 runs-on: ubuntu-latest
97 needs: [test]
98 steps:
99 - name: Install Go ${{ matrix.go }}
100 uses: actions/setup-go@v2
101 with:
102 go-version: ${{ matrix.go }}
103 - name: Checkout code
104 uses: actions/checkout@v2
105 - name: build
106 run: go build .
107 env:
108 GOOS: ${{ matrix.goos }}
109 GOARCH: ${{ matrix.goarch }}