github.com/avfs/avfs@v0.33.1-0.20240303173310-c6ba67c33eb7/.github/workflows/ci.yml (about)

     1  name: CI
     2  on: [push, pull_request]
     3  
     4  jobs:
     5    test:
     6      strategy:
     7        fail-fast: false
     8        matrix:
     9          go: [1.21.x, 1.22.x]
    10          os: [ubuntu-latest, windows-latest]
    11  
    12      runs-on: ${{ matrix.os }}
    13      steps:
    14        - name: Checkout code
    15          uses: actions/checkout@v4
    16  
    17        - name: Install Go
    18          uses: actions/setup-go@v4
    19          with:
    20            go-version: ${{ matrix.go }}
    21  
    22        - name: golangci-lint on linux
    23          if: ${{ startsWith(matrix.os, 'ubuntu') }}
    24          uses: golangci/golangci-lint-action@v4
    25  
    26        - name: Install mage & avfs binaries
    27          run: go run mage/build.go
    28  
    29        - name: Run tests as an unprivileged user
    30          run: avfs test
    31  
    32        - name: Run tests as root
    33          if: ${{ startsWith(matrix.os, 'ubuntu') }}
    34          run: avfs testAsRoot
    35  
    36        - name: Run tests as root with SetOsType
    37          env:
    38            GOFLAGS: "-tags=avfs_setostype"
    39          run: avfs testAsRoot
    40  
    41        - name: Run race tests
    42          run: avfs race
    43  
    44        - name: Upload coverage to Codecov
    45          uses: codecov/codecov-action@v3
    46          env:
    47            OS: ${{ matrix.os }}
    48            GO: ${{ matrix.go }}
    49          with:
    50            files: tmp/avfs-cover-*.txt
    51            env_vars: OS,GO
    52            verbose: true
    53  
    54        - name: Run build tests on linux
    55          if: ${{ startsWith(matrix.os, 'ubuntu') }}
    56          run: avfs testbuild
    57