Merge pull request #55 from bluegardenproject/develop #109
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| branches: [ develop, main ] | |
| push: | |
| branches: [ develop, main ] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.25" | |
| cache: true | |
| - name: Download modules | |
| run: go mod download | |
| - name: Verify modules | |
| run: go mod verify | |
| - name: gofmt | |
| run: | | |
| set -euo pipefail | |
| unformatted="$(gofmt -l .)" | |
| if [[ -n "$unformatted" ]]; then | |
| echo "::error::Files need gofmt:" | |
| echo "$unformatted" | |
| exit 1 | |
| fi | |
| - name: go vet | |
| run: go vet ./... | |
| test: | |
| name: Build & test (${{ matrix.label }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| label: Linux | |
| - os: macos-latest | |
| label: macOS | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.25" | |
| cache: true | |
| - name: Download modules | |
| run: go mod download | |
| - name: go build | |
| run: go build ./... | |
| - name: go test | |
| run: go test -race -count=1 ./... |