X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=.github%2Fworkflows%2Fgo.yml;h=47feb7efa9e5230be7be0de39dc806cdc36de32f;hb=98234f943f98032a1be79097f13b89818d821ec1;hp=d6f788fbe9ed8a397b3b4a85ebdde046696afdb9;hpb=125d7f0e905898c84345ee10de1ce775fa0c905f;p=btrtrc.git diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index d6f788fb..47feb7ef 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,46 +1,110 @@ name: Go -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] +on: [push, pull_request] jobs: - build: + test: timeout-minutes: 30 - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [ '1.19', '1.20' ] + 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 ./... - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.16 - - - name: Download Go modules - run: go mod download - - - name: Build - run: go build ./... + 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: Test - run: go test -race ./... + 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: Bench - run: go test -run @ -bench . ./... + 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 . - - name: Test on 386 - run: GOARCH=386 go test ./... -bench . - continue-on-error: true + 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/... + torrentfs-linux: + timeout-minutes: 5 + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [ '1.20' ] + os: [ubuntu-latest] + fail-fast: false + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/go-common + - name: Install godo - run: go install github.com/anacrolix/godo@latest + run: | + # Need master for cross-compiling fix + go install -v -x github.com/anacrolix/godo@master + echo $PATH - name: Apt packages run: sudo apt install pv fuse - name: torrentfs end-to-end test + # Test on 386 for atomic alignment and other bad 64-bit assumptions + run: GOARCH=386 fs/test.sh + + torrentfs-macos: + timeout-minutes: 5 + 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 + # Test on 386 for atomic alignment and other bad 64-bit assumptions run: fs/test.sh - timeout-minutes: 10