github.com/vescale/zgraph@v0.0.0-20230410094002-959c02d50f95/.github/workflows/check.yaml (about)

     1  name: Check
     2  
     3  on:
     4    push:
     5      branches:
     6        - main
     7    pull_request:
     8      branches:
     9        - main
    10  
    11  permissions:
    12    contents: read
    13  
    14  jobs:
    15    fmt:
    16      name: "Run fmt"
    17      runs-on: ubuntu-latest
    18      strategy:
    19        matrix:
    20          GO_VERSION: [ "1.20" ]
    21      steps:
    22        - uses: actions/checkout@v2
    23        - uses: actions/setup-go@v3
    24          with:
    25            go-version: ${{ matrix.GO_VERSION }}
    26        - uses: actions/cache@v3
    27          with:
    28            path: |
    29              ~/.cache/go-build
    30              ~/go/pkg/mod
    31            key: go-mod-${{ matrix.GO_VERSION }}-${{ hashFiles('go.sum') }}
    32            restore-keys: |
    33              go-mod-${{ matrix.GO_VERSION }}
    34        - run: make fmt
    35    unit-tests:
    36      name: "Unit Tests"
    37      runs-on: ubuntu-latest
    38      strategy:
    39        matrix:
    40          GO_VERSION: [ "1.20" ]
    41      steps:
    42        - uses: actions/checkout@v2
    43        - uses: actions/setup-go@v3
    44          with:
    45            go-version: ${{ matrix.GO_VERSION }}
    46        - uses: actions/cache@v3
    47          with:
    48            path: |
    49              ~/.cache/go-build
    50              ~/go/pkg/mod
    51            key: go-mod-${{ matrix.GO_VERSION }}-${{ hashFiles('go.sum') }}
    52            restore-keys: |
    53              go-mod-${{ matrix.GO_VERSION }}
    54        - run: make test