]> Sergey Matveev's repositories - btrtrc.git/blob - .github/workflows/go.yml
284b62b3d3033a922cc9943ecc36262b6fcf3e81
[btrtrc.git] / .github / workflows / go.yml
1 name: Go
2
3 on: [push, pull_request]
4
5 jobs:
6
7   test:
8     timeout-minutes: 30
9     runs-on: ubuntu-latest
10     strategy:
11       matrix:
12         go-version: [ '1.20' ]
13       fail-fast: false
14     steps:
15     - uses: actions/checkout@v2
16     - uses: ./.github/actions/go-common
17     - run: go test -race -count 2 ./...
18
19   test-benchmarks:
20     runs-on: ubuntu-latest
21     strategy:
22       matrix:
23         go-version: [ '1.20' ]
24       fail-fast: false
25     steps:
26     - uses: actions/checkout@v2
27     - uses: ./.github/actions/go-common
28     - run: go test -race -run @ -bench . -benchtime 2x ./...
29
30   bench:
31     runs-on: ubuntu-latest
32     strategy:
33       matrix:
34         go-version: [ '1.20' ]
35       fail-fast: false
36     steps:
37     - uses: actions/checkout@v2
38     - uses: ./.github/actions/go-common
39     - run: go test -run @ -bench . ./...
40
41   test-386:
42     runs-on: ubuntu-latest
43     strategy:
44       matrix:
45         go-version: [ '1.20' ]
46       fail-fast: false
47     steps:
48     - uses: actions/checkout@v2
49     - uses: ./.github/actions/go-common
50     - run: GOARCH=386 go test ./...
51     - run: GOARCH=386 go test ./... -run @ -bench .
52
53   build-wasm:
54     runs-on: ubuntu-latest
55     strategy:
56       matrix:
57         go-version: [ '1.20' ]
58       fail-fast: false
59     steps:
60     - uses: actions/checkout@v2
61     - uses: ./.github/actions/go-common
62     - name: Some packages compile for WebAssembly
63       run: GOOS=js GOARCH=wasm go build . ./storage ./tracker/...
64
65   torrentfs:
66     runs-on: ubuntu-latest
67     strategy:
68       matrix:
69         go-version: [ '1.20' ]
70       fail-fast: false
71     steps:
72     - uses: actions/checkout@v2
73     - uses: ./.github/actions/go-common
74     - name: Install godo
75       run: |
76         # Need master for cross-compiling fix
77         go install -v -x github.com/anacrolix/godo@master
78         echo $PATH
79
80     - name: Apt packages
81       run: sudo apt install pv fuse
82
83     - name: torrentfs end-to-end test
84       # Test on 386 for atomic alignment and other bad 64-bit assumptions
85       run: GOARCH=386 fs/test.sh