Fixing executions. #29
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: Unit tests | |
| on: | |
| push: | |
| branches: [ "**" ] | |
| paths: | |
| - "**.go" | |
| - "go.mod" | |
| - "go.sum" | |
| - "Taskfile.yaml" | |
| - ".github/workflows/test.yml" | |
| pull_request: | |
| branches: [ "**" ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up Go 1.26.3 | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.26.3' | |
| cache: false # usem cache manual per controlar directoris | |
| - name: Cache Go modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/go/pkg/mod | |
| ~/.cache/go-build | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Install Task | |
| run: | | |
| go install github.com/go-task/task/v3/cmd/task@latest | |
| echo "$HOME/go/bin" >> $GITHUB_PATH | |
| - name: Run tests | |
| run: | | |
| task test | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} |