Merge pull request #57 from go-tstr/dependabot/go_modules/github.com/… #140
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 | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| push: | |
| branches: | |
| - main | |
| release: | |
| types: | |
| - published | |
| env: | |
| IS_PR: ${{github.event_name == 'pull_request' || ''}} | |
| IS_MAIN: ${{github.event_name == 'push' || ''}} | |
| IS_RELEASE: ${{github.event_name == 'release' || ''}} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache/restore@v4 | |
| with: | |
| key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }} | |
| restore-keys: ${{ runner.os }}-go- | |
| path: | | |
| ~/.cache/golangci-lint | |
| ~/.cache/go-build | |
| ~/go/pkg/mod | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: false | |
| - name: Install dependencies | |
| run: go mod download | |
| - name: Lint | |
| run: make lint | |
| - name: Test | |
| run: make test | |
| - name: Upload results to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage.txt | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./junit.xml | |
| - uses: actions/cache/save@v4 | |
| if: ${{ env.IS_MAIN }} | |
| with: | |
| key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }} | |
| path: | | |
| ~/.cache/golangci-lint | |
| ~/.cache/go-build | |
| ~/go/pkg/mod |