-
Notifications
You must be signed in to change notification settings - Fork 416
72 lines (72 loc) · 1.73 KB
/
tests.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
63
64
65
66
67
68
69
70
71
72
name: tests
on:
workflow_call:
inputs:
stress-tests:
description: 'Run stress tests'
required: false
type: boolean
default: false
codecov:
required: false
type: boolean
default: false
runs-on:
required: false
type: string
default: 'ubuntu-latest'
secrets:
codecov_token:
required: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '^1.21.1'
- run: make build
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '^1.21.1'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
tests:
needs: [build]
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '^1.21.1'
- run: cat .env >> $GITHUB_ENV || true
- run: make up
- run: make wait
- run: make test_short
- run: make test
timeout-minutes: 30
- run: make test_race
- run: make test_stress
if: ${{ inputs.stress-tests }}
codecov:
runs-on: ${{ inputs.runs-on }}
if: ${{ inputs.codecov }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '^1.21.1'
- run: cat .env >> $GITHUB_ENV || true
- run: make up
- run: make wait
- run: make test_codecov
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: ./coverage.out
token: ${{ secrets.codecov_token }}