]> Sergey Matveev's repositories - btrtrc.git/blob - .github/workflows/go.yml
5a627b5e745d8264d4d85c36ebd87be288a9ac41
[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: ${{ matrix.os }}
10     strategy:
11       matrix:
12         go-version: [ '1.19', '1.20' ]
13         os: [windows-latest, macos-latest, ubuntu-latest]
14       fail-fast: false
15     steps:
16     - uses: actions/checkout@v2
17     - uses: ./.github/actions/go-common
18     - run: go test -race -count 2 ./...
19
20   test-benchmarks:
21     runs-on: ubuntu-latest
22     strategy:
23       matrix:
24         go-version: [ '1.20' ]
25       fail-fast: false
26     steps:
27     - uses: actions/checkout@v2
28     - uses: ./.github/actions/go-common
29     - run: go test -race -run @ -bench . -benchtime 2x ./...
30
31   bench:
32     runs-on: ubuntu-latest
33     strategy:
34       matrix:
35         go-version: [ '1.20' ]
36       fail-fast: false
37     steps:
38     - uses: actions/checkout@v2
39     - uses: ./.github/actions/go-common
40     - run: go test -run @ -bench . ./...
41
42   test-386:
43     runs-on: ubuntu-latest
44     strategy:
45       matrix:
46         go-version: [ '1.20' ]
47       fail-fast: false
48     steps:
49     - uses: actions/checkout@v2
50     - uses: ./.github/actions/go-common
51     - run: GOARCH=386 go test ./...
52     - run: GOARCH=386 go test ./... -run @ -bench .
53
54   build-wasm:
55     runs-on: ubuntu-latest
56     strategy:
57       matrix:
58         go-version: [ '1.20' ]
59       fail-fast: false
60     steps:
61     - uses: actions/checkout@v2
62     - uses: ./.github/actions/go-common
63     - name: Some packages compile for WebAssembly
64       run: GOOS=js GOARCH=wasm go build . ./storage ./tracker/...
65
66   torrentfs-linux:
67     timeout-minutes: 5
68     runs-on: ${{ matrix.os }}
69     strategy:
70       matrix:
71         go-version: [ '1.20' ]
72         os: [ubuntu-latest]
73       fail-fast: false
74     steps:
75     - uses: actions/checkout@v2
76     - uses: ./.github/actions/go-common
77         
78     - name: Install godo
79       run: |
80         # Need master for cross-compiling fix
81         go install -v -x github.com/anacrolix/godo@master
82         echo $PATH
83
84     - name: Apt packages
85       run: sudo apt install pv fuse
86
87     - name: torrentfs end-to-end test
88       # Test on 386 for atomic alignment and other bad 64-bit assumptions
89       run: GOARCH=386 fs/test.sh
90
91   torrentfs-macos:
92     timeout-minutes: 15
93     runs-on: ${{ matrix.os }}
94     strategy:
95       matrix:
96         go-version: [ '1.20' ]
97         os: [macos-latest]
98       fail-fast: false
99     steps:
100     - uses: actions/checkout@v2
101     - uses: ./.github/actions/go-common
102
103     - run: brew install macfuse pv md5sha1sum bash
104         
105     - name: Install godo
106       run: go install -v github.com/anacrolix/godo@master
107
108     - name: torrentfs end-to-end test
109       run: fs/test.sh
110       # Pretty sure macos on GitHub CI has issues with the fuse driver now.
111       continue-on-error: true