-
Notifications
You must be signed in to change notification settings - Fork 7
144 lines (117 loc) · 3.77 KB
/
Copy pathgo.yml
File metadata and controls
144 lines (117 loc) · 3.77 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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
---
name: Go
on:
pull_request:
types:
- unlabeled # if GitHub Actions stuck, add and remove "not ready" label to force rebuild
- opened
- reopened
- synchronize
push:
branches:
- main
schedule:
- cron: "12 0 * * *"
env:
GOPATH: /home/runner/go
GOCACHE: /home/runner/go/cache
GOLANGCI_LINT_CACHE: /home/runner/go/cache/lint
GOMODCACHE: /home/runner/go/mod
GOPROXY: https://proxy.golang.org
GOTOOLCHAIN: local
jobs:
test:
name: Test ${{ matrix.service }}
runs-on: ubuntu-24.04
timeout-minutes: 15
# Do not run this job in parallel for any PR change or branch push.
concurrency:
group: ${{ github.workflow }}-test-${{ matrix.service }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'not ready')
strategy:
fail-fast: false
matrix:
include:
# keep in sync with Taskfile.yml's test-all
- service: MongoDB
uri: mongodb://username:password@127.0.0.1:27017/invalid?authSource=admin&authMechanism=SCRAM-SHA-256
- service: MongoDB TLS
uri: mongodb://username:password@127.0.0.1:37017/admin?tls=true&tlsCaFile=../.dev/build/certs/rootCA-cert.pem
- service: FerretDB v2
uri: mongodb://username:password@127.0.0.1:27018/
- service: FerretDB v1
uri: mongodb://username:password@127.0.0.1:27019/?authMechanism=PLAIN
flags: -ferretdbv1
permissions:
contents: read
steps:
# TODO https://github.com/FerretDB/github-actions/issues/211
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: FerretDB/github-actions/setup-go@main
with:
cache-key: test
- name: Install Task and tools
run: go generate -x
working-directory: tools
- name: Init
run: bin/task init
- name: Run code generators (and formatters)
run: bin/task gen
- name: Run short tests
run: bin/task test-short
- name: Start Docker Compose services
run: bin/task env-up-detach
- name: Run all tests
run: bin/task test
env:
MONGODB_URI: ${{ matrix.uri }}
TEST_FLAGS: ${{ matrix.flags }}
- name: Get logs
if: always()
run: bin/task env-logs
- name: Run linters
run: bin/task lint
- name: Upload coverage information to codecov
if: always()
uses: codecov/codecov-action@v5
with:
files: ./cover.txt
flags: test
fail_ci_if_error: true
verbose: true
- name: Upload coverage information to coveralls
uses: coverallsapp/github-action@v2
with:
file: ./cover.txt
flag-name: test
- name: Check dirty
run: |
git status
git diff --exit-code
fuzz:
name: Fuzz
runs-on: ubuntu-24.04
timeout-minutes: 15
# Do not run this job in parallel for any PR change or branch push.
concurrency:
group: ${{ github.workflow }}-fuzz-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'not ready')
permissions:
contents: read
steps:
# TODO https://github.com/FerretDB/github-actions/issues/211
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: FerretDB/github-actions/setup-go@main
with:
cache-key: fuzz
- name: Install Task and tools
run: go generate -x
working-directory: tools
- name: Run fuzzers
run: bin/task fuzz