chores: cache more path #12
This file contains 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: Quality | |
on: | |
push: | |
paths: | |
- "**/*.go" | |
- ".github/workflows/**" | |
pull_request: | |
paths: | |
- "**/*.go" | |
- ".github/workflows/**" | |
jobs: | |
setup: | |
name: Repo Setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-go-mod | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: | | |
~/go/pkg | |
~/.cache/go-build | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: | | |
go mod download -x | |
# - name: Run Lint | |
# uses: golangci/golangci-lint-action@v3 | |
# with: | |
# version: v1.55 | |
- name: Run Unit tests | |
run: | | |
go test -race -coverpkg="mgufrone.dev/job-tracking/..." -coverprofile=profile.cov ./... | |
- name: Check coverage | |
run: | | |
cat profile.cov | |
- name: Send coverage | |
uses: shogo82148/actions-goveralls@v1 | |
with: | |
path-to-profile: profile.cov |