ci: update actions/checkout action to v4 (#419) #1842
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: Test | |
on: | |
push: | |
branches-ignore: | |
- renovate/** | |
paths: | |
- ".github/workflows/test.yaml" | |
- "go.mod" | |
- "go.sum" | |
- "Taskfile.yaml" | |
- "**.go" | |
- "**.go.json" | |
pull_request: | |
branches: | |
- master | |
paths: | |
- ".github/workflows/test.yaml" | |
- "go.mod" | |
- "go.sum" | |
- "Taskfile.yaml" | |
- "**.go" | |
- "**.go.json" | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- run: git clone https://github.com/bangumi/dev-env $HOME/dev-env | |
- run: cd ~/dev-env && docker-compose up -d | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: "go.mod" | |
cache: false | |
- name: Install Task | |
uses: arduino/setup-task@v1 | |
with: | |
repo-token: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Go Build Cache (test) | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg | |
key: go-cache-119-${{ hashFiles('**/go.sum') }}-test | |
restore-keys: | | |
go-cache-119-${{ hashFiles('**/go.sum') }}- | |
go-cache-119- | |
- run: go get -t ./... | |
- run: bash $HOME/dev-env/wait_mysql_ready.sh | |
- name: Run tests | |
run: task coverage | |
env: | |
GORACE: halt_on_error=1 | |
MYSQL_HOST: 127.0.0.1 | |
MYSQL_PORT: "3306" | |
MYSQL_USER: user | |
MYSQL_PASS: password | |
MYSQL_DB: bangumi | |
REDIS_URI: "redis://:[email protected]:6379/0" | |
- uses: codecov/codecov-action@v3 | |
with: | |
files: coverage.out |