Merge pull request #196 from TheThingsNetwork/dependabot/github_actio… #544
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: Go Code | |
| on: | |
| push: | |
| branches: master | |
| pull_request: | |
| paths: | |
| - '*.go' | |
| - 'cmd/**' | |
| - 'go.mod' | |
| - 'go.sum' | |
| - 'pkg/**' | |
| jobs: | |
| quality: | |
| name: Go Code Quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out Code | |
| uses: actions/checkout@v5 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '~1.24' | |
| - name: Initialize Go module cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Download Go dependencies | |
| run: go mod download | |
| - name: Remove unnecessary type conversions | |
| run: make go.unconvert | |
| - name: Format Code | |
| run: make go.fmt | |
| - name: Lint Code | |
| run: make go.lint | |
| - name: Generate Code | |
| run: make go.generate | |
| - name: Check for diff | |
| run: make git.diff | |
| test: | |
| name: Go Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out Code | |
| uses: actions/checkout@v5 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '~1.24' | |
| - name: Initialize Go module cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Download Go dependencies | |
| run: go mod download | |
| - name: Test binary execution | |
| run: make go.binaries | |
| - name: Unit tests | |
| run: make go.test |