-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (48 loc) · 1.47 KB
/
go_tests_lint.yml
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
# CI : test, build, lint
name: Code quality
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: build
run: go build ./...
- name: test
run: go test -v -coverprofile=go-coverage.out -json ./... | tee go-test-report.json
- name: Archive test results
uses: actions/upload-artifact@v3
with:
name: code-test-report
path: go-test-report.json
retention-days: 1
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: go-coverage.out
retention-days: 1
test-server:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: run server
run: go run main.go serve --data cmd/service/db/data/testData.gen.json &
- name: check server
run: timeout 30s bash -c 'until [ $(curl --output /dev/null --silent --fail --write-out "%{http_code}" "http://localhost:1323") -ne "000" ]; do printf "."; sleep 1; done;'
- name: test commands 1
run: bash cmd/test/commands/testCommands.gen.sh
- name: test commands 2
run: bash cmd/test/commands/testDifferentSyntaxes.sh