]> Sergey Matveev's repositories - btrtrc.git/blobdiff - .github/workflows/go.yml
Switch Go CI to go1.20
[btrtrc.git] / .github / workflows / go.yml
index 0037abe1f3b48ec1d3a1fab25372a55b8bf35a92..284b62b3d3033a922cc9943ecc36262b6fcf3e81 100644 (file)
@@ -4,39 +4,73 @@ on: [push, pull_request]
 
 jobs:
 
-  build:
+  test:
     timeout-minutes: 30
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        go-version: [ '1.16', '1.17' ]
+        go-version: [ '1.20' ]
       fail-fast: false
     steps:
     - uses: actions/checkout@v2
+    - uses: ./.github/actions/go-common
+    - run: go test -race -count 2 ./...
 
-    - name: Set up Go
-      uses: actions/setup-go@v2
-      with:
-        go-version: ${{ matrix.go-version }}
-
-    - 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.20' ]
+      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.20' ]
+      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.20' ]
+      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.20' ]
+      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:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        go-version: [ '1.20' ]
+      fail-fast: false
+    steps:
+    - uses: actions/checkout@v2
+    - uses: ./.github/actions/go-common
     - name: Install godo
       run: |
         # Need master for cross-compiling fix
@@ -49,4 +83,3 @@ 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