-
Notifications
You must be signed in to change notification settings - Fork 76
75 lines (65 loc) · 1.83 KB
/
Copy pathtest.yaml
File metadata and controls
75 lines (65 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Test
on:
push:
branches:
- master
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-24.04
steps:
- run: git clone https://github.com/bangumi/dev-env $HOME/dev-env --branch=gh-pages
- run: cd ~/dev-env && docker compose up -d
- uses: actions/checkout@v7.0.1
with:
submodules: recursive
- uses: trim21/actions/setup-go@master
with:
cache-namespace: test
- name: Install Task
uses: arduino/setup-task@v2.0.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Install gotestsum
uses: jaxxstorm/action-install-gh-release@v3.0.0
with:
repo: gotestyourself/gotestsum
tag: v1.13.0
platform: linux
arch: amd64
env:
GITHUB_TOKEN: "${{ github.token }}"
- run: go get -t ./...
- run: bash $HOME/dev-env/wait_mysql_ready.sh
- name: Run tests
run: gotestsum --format-hide-empty-pkg -- -timeout 10s -tags test -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.out ./...
env:
GORACE: halt_on_error=1
TEST_MYSQL: "1"
TEST_REDIS: "1"
MYSQL_HOST: 127.0.0.1
MYSQL_PORT: "3306"
MYSQL_USER: user
MYSQL_PASS: password
MYSQL_DB: bangumi
REDIS_URI: "redis://:redis-pass@127.0.0.1:6379/0"
- uses: codecov/codecov-action@v7.0.0
with:
files: coverage.out
token: ${{ secrets.CODECOV_TOKEN }} # required