github.com/whoyao/protocol@v0.0.0-20230519045905-2d8ace718ca5/.github/workflows/buildtest.yaml (about)

     1  name: Test
     2  
     3  on:
     4    workflow_dispatch:
     5    push:
     6      branches: [ main ]
     7    pull_request:
     8      branches: [ main ]
     9  
    10  jobs:
    11    test:
    12      runs-on: ubuntu-latest
    13      steps:
    14      - uses: actions/checkout@v3
    15      - uses: actions/cache@v3
    16        with:
    17          path: |
    18            ~/go/pkg/mod
    19            ~/go/bin
    20            ~/.cache
    21          key: livekit-protocol
    22  
    23      - name: Set up Go
    24        uses: actions/setup-go@v4
    25        with:
    26          go-version: 1.18
    27  
    28      - name: Set up gotestfmt
    29        run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@v2.4.1
    30  
    31      - name: Download Go modules
    32        run: go mod download
    33  
    34      - name: Static Check
    35        uses: dominikh/staticcheck-action@v1.3.0
    36        with:
    37          checks: '["all", "-ST1000", "-ST1003", "-ST1020", "-ST1021", "-ST1022", "-SA1019"]'
    38          version: "2022.1.3"
    39  
    40      - name: Test
    41        run: |
    42          set -euo pipefail
    43          MallocNanoZone=0 go test -race -json -v ./... 2>&1 | gotestfmt