github.com/kaptinlin/jsonschema@v0.4.6/.github/workflows/ci.yml (about)

     1  name: Go
     2  
     3  on:
     4    push:
     5      branches:
     6        - main
     7    pull_request:
     8  
     9  jobs:
    10    test:
    11      name: Test
    12      runs-on: ubuntu-latest
    13      steps:
    14        - name: Check out repository
    15          uses: actions/checkout@v4
    16  
    17        - name: Initialize submodules
    18          run: git submodule update --init --recursive
    19  
    20        - name: Set up Go
    21          uses: actions/setup-go@v5
    22          with:
    23            go-version: 1.22.x
    24  
    25        - name: Download dependencies
    26          run: go mod download
    27  
    28        - name: Run unit tests
    29          run: make test
    30  
    31    lint:
    32      name: Lint
    33      runs-on: ubuntu-latest
    34      steps:
    35        - name: Check out repository
    36          uses: actions/checkout@v4
    37  
    38        - name: Set up Go
    39          uses: actions/setup-go@v5
    40          with:
    41            go-version: 1.22.x
    42  
    43        - name: Read golangci-lint version from .golangci.version
    44          id: golangci-version
    45          run: echo "GOLANGCI_VERSION=$(cat .golangci.version)" > $GITHUB_OUTPUT
    46  
    47        - uses: golangci/golangci-lint-action@v8
    48          name: Install and run golangci-lint
    49          with:
    50            version: v${{ steps.golangci-version.outputs.GOLANGCI_VERSION }}
    51            args: -h
    52  
    53        - run: make lint
    54          name: Lint