]> Sergey Matveev's repositories - btrtrc.git/blob - .github/workflows/go.yml
go CI: Add GOPATH bin to GITHUB_PATH
[btrtrc.git] / .github / workflows / go.yml
1 name: Go
2
3 on: [push, pull_request]
4
5 jobs:
6
7   build:
8     timeout-minutes: 30
9     runs-on: ubuntu-latest
10     strategy:
11       matrix:
12         go-version: [ 'tip' ]
13       fail-fast: false
14     steps:
15     - uses: actions/checkout@v2
16
17     - name: Set up Go
18       if: matrix.go-version != 'tip'
19       uses: actions/setup-go@v2
20       with:
21         go-version: ${{ matrix.go-version }}
22
23     - name: Install gotip
24       if: matrix.go-version == 'tip'
25       run: |
26         git clone --depth=1 https://go.googlesource.com/go "$HOME/gotip"
27         cd "$HOME/gotip/src"
28         ./make.bash
29         echo "GOROOT=$HOME/gotip" >> "$GITHUB_ENV"
30         echo "$HOME/gotip/bin:$PATH" >> "$GITHUB_PATH"
31         echo "$(go env GOPATH)/bin:$PATH" >> "$GITHUB_PATH"
32
33     - name: Test
34       run: go test -race -count 2 ./...
35
36     - name: Test Benchmarks
37       run: go test -race -run @ -bench . -benchtime 2x ./...
38
39     - name: Bench
40       run: go test -run @ -bench . ./...
41
42     - name: Test on 386
43       run: GOARCH=386 go test ./... -bench .
44       continue-on-error: true
45
46     - name: Some packages compile for WebAssembly
47       run: GOOS=js GOARCH=wasm go build . ./storage ./tracker/...
48       # https://github.com/pion/webrtc/issues/2099
49       continue-on-error: true
50
51     - name: Install godo
52       run: |
53         # Need master for cross-compiling fix
54         go install -v -x github.com/anacrolix/godo@master
55         echo $PATH
56
57     - name: Apt packages
58       run: sudo apt install pv fuse
59
60     - name: torrentfs end-to-end test
61       # Test on 386 for atomic alignment and other bad 64-bit assumptions
62       run: GOARCH=386 fs/test.sh
63       timeout-minutes: 10