chore(deps): update actions/cache action to v5 #106
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: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| go-version: [1.15.x,1.16.x] | |
| runs-on: ubuntu-latest | |
| services: | |
| mysql: | |
| image: mysql:5.7 | |
| env: | |
| MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
| MYSQL_DATABASE: app | |
| ports: | |
| - 3306:3306 | |
| options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Go | |
| uses: actions/setup-go@v2 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| - uses: actions/cache@v5 | |
| id: cache-go-mod | |
| with: | |
| path: ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('go.mod') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go-${{ matrix.go-version }} | |
| - name: Environment Variables from Dotenv | |
| uses: c-py/action-dotenv-to-setenv@v3 | |
| - name: Build | |
| if: steps.cache-go-mod.outputs.cache-hit != 'true' | |
| run: go build -v ./... | |
| - name: Test | |
| run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: coverage.txt | |
| lint: | |
| name: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Lint | |
| uses: golangci/golangci-lint-action@v2 | |
| with: | |
| version: v1.41 | |
| args: --disable errcheck --timeout 5m0s | |
| only-new-issues: true |