github.com/nxtrace/NTrace-core@v1.3.1-0.20240513132635-39169291e8c9/.github/workflows/test.yml (about)

     1  name: Test
     2  
     3  on:
     4    push:
     5      branches:
     6        - main
     7      paths:
     8        - "**/*.go"
     9        - "go.mod"
    10        - "go.sum"
    11        - ".github/workflows/*.yml"
    12    pull_request:
    13      types: [opened, synchronize, reopened]
    14      paths:
    15        - "**/*.go"
    16        - "go.mod"
    17        - "go.sum"
    18        - ".github/workflows/*.yml"
    19    workflow_dispatch:
    20  
    21  jobs:
    22    test:
    23      permissions:
    24        contents: read
    25      runs-on: ${{ matrix.os }}
    26      strategy:
    27        fail-fast: false
    28        matrix:
    29          os: [windows-latest, ubuntu-latest, macos-latest]
    30      steps:
    31        - name: Set up Go
    32          uses: actions/setup-go@v5
    33          with:
    34            go-version: '1.22'
    35            check-latest: true
    36        - name: Checkout codebase
    37          uses: actions/checkout@v4
    38        - name: Test with unix
    39          if: ${{ matrix.os != 'windows-latest' }}
    40          run: sudo go test -v -coverprofile='coverage.out' -covermode=count ./...
    41        - name: Test with windows
    42          if: ${{ matrix.os == 'windows-latest' }}
    43          run: go test -v -coverprofile='coverage.out' -covermode=count ./...