]> Sergey Matveev's repositories - btrtrc.git/blob - .github/workflows/go.yml
Ensure gotip bin is used for go
[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 "$(go env GOPATH)/bin:$PATH" >> "$GITHUB_PATH"
31         echo "$HOME/gotip/bin:$PATH" >> "$GITHUB_PATH"
32         env
33
34     - name: Test
35       run: go test -race -count 2 ./...
36
37     - name: Test Benchmarks
38       run: go test -race -run @ -bench . -benchtime 2x ./...
39
40     - name: Bench
41       run: go test -run @ -bench . ./...
42
43     - name: Test on 386
44       run: GOARCH=386 go test ./... -bench .
45       continue-on-error: true
46
47     - name: Some packages compile for WebAssembly
48       run: GOOS=js GOARCH=wasm go build . ./storage ./tracker/...
49       # https://github.com/pion/webrtc/issues/2099
50       continue-on-error: true
51
52     - name: Install godo
53       run: |
54         # Need master for cross-compiling fix
55         go install -v -x github.com/anacrolix/godo@master
56         echo $PATH
57
58     - name: Apt packages
59       run: sudo apt install pv fuse
60
61     - name: torrentfs end-to-end test
62       # Test on 386 for atomic alignment and other bad 64-bit assumptions
63       run: GOARCH=386 fs/test.sh
64       timeout-minutes: 10