Merge pull request #5 from scalytics/novatechflow/ci-workflows-and-ba… #1
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: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| go-ci: | |
| name: Go Checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.24.13" | |
| cache-dependency-path: go.sum | |
| - name: Verify formatting (gofmt) | |
| run: | | |
| unformatted="$(gofmt -l .)" | |
| if [ -n "$unformatted" ]; then | |
| echo "The following files are not gofmt-formatted:" | |
| echo "$unformatted" | |
| exit 1 | |
| fi | |
| - name: Go vet | |
| run: go vet ./... | |
| - name: Run tests | |
| run: go test ./... | |
| - name: Run race detector | |
| run: go test -race ./... | |
| - name: Upload coverage artifact | |
| run: go test -coverprofile=coverage.out ./... | |
| - name: Store coverage file | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage.out | |
| path: coverage.out |