github.com/onflow/atree@v0.6.0/.github/workflows/ci.yml (about)

     1  # GitHub Actions - CI for Go to build & test.
     2  # Based on copy of https://github.com/fxamacker/cbor/workflows/ci.yml
     3  name: ci
     4  
     5  # Remove default permissions at top level and grant in jobs.
     6  permissions: {}
     7  
     8  on:
     9    workflow_dispatch:
    10    push:
    11      branches:
    12      - main
    13      - 'feature/**'
    14      - 'v**'  
    15    pull_request:
    16      branches:
    17      - main
    18      - 'feature/**'
    19      - 'v**'
    20  
    21  jobs:
    22  
    23    # Test on various OS with default Go version. 
    24    tests:
    25      name: Test on ${{matrix.os}}
    26      runs-on: ${{ matrix.os }}
    27  
    28      permissions:
    29        contents: read
    30  
    31      strategy:
    32        matrix:
    33          os: [macos-latest, ubuntu-latest]
    34          go-version: [1.17, 1.18, 1.19]
    35  
    36      steps:
    37      - name: Install Go
    38        uses: actions/setup-go@v3
    39        with:
    40          go-version: ${{ matrix.go-version }}
    41          check-latest: true
    42  
    43      - name: Checkout code
    44        uses: actions/checkout@v3
    45        with:
    46          fetch-depth: 1
    47  
    48      - name: Get dependencies
    49        run: go get -v -t -d ./...
    50  
    51      - name: Build project
    52        run: go build ./...
    53  
    54      - name: Run tests
    55        run: |
    56          go version
    57          go test -timeout 60m -race -v ./...