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