github.com/anacrolix/torrent@v1.61.0/.github/workflows/go.yml (about)

     1  name: Go
     2  
     3  on: [push, pull_request]
     4  
     5  jobs:
     6    test:
     7      timeout-minutes: 20
     8      runs-on: ${{ matrix.os }}
     9      strategy:
    10        matrix:
    11          go-version: [ stable, oldstable]
    12          # windows-latest removed for now: known issues with file handles to
    13          # resolved. could set classic file io mode.
    14          os: [macos-latest, ubuntu-latest]
    15        fail-fast: false
    16      steps:
    17        - uses: actions/checkout@v4
    18          with:
    19            submodules: true
    20        - uses: actions/setup-go@v5
    21          with:
    22            go-version: ${{ matrix.go-version }}
    23        - run: brew install macfuse fuse-t && echo 'FUSE_FORCE_BACKEND=fuse-t' >> $GITHUB_ENV
    24          if: matrix.os == 'macos-latest'
    25        - run: |
    26            sudo apt update
    27            sudo apt install -y fuse
    28          if: matrix.os == 'ubuntu-latest'
    29        - uses: dtolnay/rust-toolchain@stable
    30        - name: Install just
    31          run: cargo install just
    32        - name: Build possum
    33          run: |
    34            cd storage/possum/lib
    35            cargo build --lib
    36        # Separate to remove downloading spam and possible caching improvement.
    37        - run: go mod download
    38        - run: just test
    39          # Test on 386 for atomic alignment and other bad 64-bit assumptions
    40        - if: matrix.os != 'macos-latest'
    41          run: GOARCH=386 go test -run @ ./...
    42        - name: Some packages compile for WebAssembly
    43          run: GOOS=js GOARCH=wasm go build . ./storage ./tracker/...
    44  
    45        - name: Test global installability
    46          run: |
    47            # Create isolated environment
    48            TMPDIR=$(mktemp -d)
    49            cd "$TMPDIR"
    50  
    51            # Init a dummy module to avoid any local go.mod influence
    52            go mod init dummy
    53  
    54            # This should succeed if your module is properly published
    55            go install github.com/anacrolix/torrent/cmd/torrent@${{ github.ref_name }}
    56  
    57            # Verify it runs
    58            $(go env GOPATH)/bin/torrent version