]> Sergey Matveev's repositories - btrtrc.git/blobdiff - .github/workflows/go.yml
Drop support for go 1.20
[btrtrc.git] / .github / workflows / go.yml
index c124f87d4ede8b7beca4d02c623d660e367259bc..e95f82604f5cc5234f91a0cb825a2b98f620fc63 100644 (file)
@@ -4,50 +4,79 @@ on: [push, pull_request]
 
 jobs:
 
-  build:
-    timeout-minutes: 30
-    runs-on: ubuntu-latest
+  test:
+    timeout-minutes: 10
+    runs-on: ${{ matrix.os }}
     strategy:
       matrix:
-        go-version: [ 'tip' ]
+        go-version: [ '1.21' ]
+        os: [windows-latest, macos-latest, ubuntu-latest]
       fail-fast: false
     steps:
     - uses: actions/checkout@v2
+    - uses: ./.github/actions/go-common
+    - run: go test -race -count 2 $(go list ./... | grep -v /fs)
+    - run: go test -race -count 2 ./fs/...
+      if: ${{ ! contains(matrix.os, 'windows') }}
 
-    - name: Set up Go
-      if: matrix.go-version != 'tip'
-      uses: actions/setup-go@v2
-      with:
-        go-version: ${{ matrix.go-version }}
-
-    - name: Install gotip
-      if: matrix.go-version == 'tip'
-      run: |
-        git clone --depth=1 https://go.googlesource.com/go "$HOME/gotip"
-        cd "$HOME/gotip/src"
-        ./make.bash
-        echo "GOROOT=$HOME/gotip" >> "$GITHUB_ENV"
-        echo "$HOME/gotip/bin:$PATH" >> "$GITHUB_PATH"
-        echo "$(go env GOPATH)/bin:$PATH" >> "$GITHUB_PATH"
-
-    - name: Test
-      run: go test -race -count 2 ./...
-
-    - name: Test Benchmarks
-      run: go test -race -run @ -bench . -benchtime 2x ./...
+  test-benchmarks:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        go-version: [ '1.21' ]
+      fail-fast: false
+    steps:
+    - uses: actions/checkout@v2
+    - uses: ./.github/actions/go-common
+    - run: go test -race -run @ -bench . -benchtime 2x ./...
 
-    - name: Bench
-      run: go test -run @ -bench . ./...
+  bench:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        go-version: [ '1.21' ]
+      fail-fast: false
+    steps:
+    - uses: actions/checkout@v2
+    - uses: ./.github/actions/go-common
+    - run: go test -run @ -bench . ./...
 
-    - name: Test on 386
-      run: GOARCH=386 go test ./... -bench .
-      continue-on-error: true
+  test-386:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        go-version: [ '1.21' ]
+      fail-fast: false
+    steps:
+    - uses: actions/checkout@v2
+    - uses: ./.github/actions/go-common
+    - run: GOARCH=386 go test ./...
+    - run: GOARCH=386 go test ./... -run @ -bench .
 
+  build-wasm:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        go-version: [ '1.21' ]
+      fail-fast: false
+    steps:
+    - uses: actions/checkout@v2
+    - uses: ./.github/actions/go-common
     - name: Some packages compile for WebAssembly
       run: GOOS=js GOARCH=wasm go build . ./storage ./tracker/...
-      # https://github.com/pion/webrtc/issues/2099
-      continue-on-error: true
 
+  torrentfs-linux:
+    timeout-minutes: 5
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        go-version: [ '1.21' ]
+        os: [ubuntu-latest]
+      fail-fast: false
+    steps:
+    - uses: actions/checkout@v2
+    - uses: ./.github/actions/go-common
+        
     - name: Install godo
       run: |
         # Need master for cross-compiling fix
@@ -60,4 +89,27 @@ jobs:
     - name: torrentfs end-to-end test
       # Test on 386 for atomic alignment and other bad 64-bit assumptions
       run: GOARCH=386 fs/test.sh
-      timeout-minutes: 10
+
+# Github broke FUSE on MacOS, I'm not sure what the state is.
+
+#  torrentfs-macos:
+#    timeout-minutes: 15
+#    runs-on: ${{ matrix.os }}
+#    strategy:
+#      matrix:
+#        go-version: [ '1.20' ]
+#        os: [macos-latest]
+#      fail-fast: false
+#    steps:
+#    - uses: actions/checkout@v2
+#    - uses: ./.github/actions/go-common
+#
+#    - run: brew install macfuse pv md5sha1sum bash
+#
+#    - name: Install godo
+#      run: go install -v github.com/anacrolix/godo@master
+#
+#    - name: torrentfs end-to-end test
+#      run: fs/test.sh
+#      # Pretty sure macos on GitHub CI has issues with the fuse driver now.
+#      continue-on-error: true