-
Notifications
You must be signed in to change notification settings - Fork 4
106 lines (86 loc) · 2.65 KB
/
tests.yaml
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Tests
env:
CI: true
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
schedule:
- cron: '0 0 */3 * *'
jobs:
run:
timeout-minutes: 60
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: ./.github/actions/setup
# source .envrc instead of direnv setup
- name: Setup project
run: |
source .envrc
# go mod download # it will access network/cache, which is not necessary with -mod=vendor
go mod verify
project test.backend.setup
project lint
- name: Test frontend
run: |
source .envrc
project test.frontend
- name: Diff check
run: |
# debug gen: run with --x-force-regen
git diff --exit-code # -- . ':!dir_to_skip'
untracked_files=$(git ls-files --others --exclude-standard)
if [ -n "$untracked_files" ]; then
echo "[ERROR] Found untracked files:"
echo "${untracked_files[*]}"
exit 1
fi
- name: Vet
run: |
source .envrc
go vet ./...
go install golang.org/x/tools/go/analysis/passes/nilness/cmd/nilness@latest
nilness ./...
- name: Test backend
run: |
source .envrc
{
while sleep 1; do project db.conns-db postgres_test --x-no-exit-cleanup; done
} &
bg_pid=$!
echo -------1-------
POSTGRES_TRACE=false project test.create-crud-gen
echo -------2-------
POSTGRES_TRACE=false project test.backend -race -count=50 -timeout=40m
echo -------3-------
# some tests are skipped from race
POSTGRES_TRACE=false project test.backend -count=3 -timeout=40m
{ test -n "$bg_pid" && kill $bg_pid; } || true
- name: Postgres logs
if: failure() # always()
run: docker logs postgres_db_openapi-go-gin
- name: Test E2E
run: |
source .envrc
project e2e.run
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: e2e/playwright-report/
retention-days: 5
# TODO: reuse actions/setup:
# https://stackoverflow.com/questions/65242830/in-a-github-actions-workflow-is-there-a-way-to-have-multiple-jobs-reuse-the-sam
# https://github.com/kmadof/github-actions-manual/blob/main/.github/actions/say-hello/action.yml
- name: Build frontend
run: |
source .envrc
project build.frontend