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