-
Notifications
You must be signed in to change notification settings - Fork 40
171 lines (165 loc) · 4.66 KB
/
.test-api.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
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
---
name: . Test API
'on':
workflow_call:
inputs:
# Workflows
workflow:
required: true
type: boolean
# Applications
api-go:
required: true
type: boolean
api-node:
required: true
type: boolean
api-python:
required: true
type: boolean
api-rust:
required: true
type: boolean
jobs:
api-go-test:
name: API - Go | Test
if: ${{ inputs.workflow || inputs.api-go }}
runs-on: ubuntu-24.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Set up Go
uses: actions/setup-go@v5.3.0
with:
go-version-file: api-go/go.mod
cache-dependency-path: api-go/go.sum
- name: Test
working-directory: api-go
run: |
go test ./... -race -coverprofile=coverage.txt -covermode=atomic
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5.3.1
with:
directory: api-go
api-node-test:
name: API - Node.js | Test
if: ${{ inputs.workflow || inputs.api-node }}
runs-on: ubuntu-24.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Set up Node.js
uses: actions/setup-node@v4.2.0
with:
node-version-file: api-node/.node-version
cache: npm
cache-dependency-path: api-node/package-lock.json
- name: Install dependencies
working-directory: api-node
run: |
npm ci
- name: Test
working-directory: api-node
run: |
npm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5.3.1
with:
directory: api-node
api-node-mutation-test:
name: API - Node.js | Mutation Test
if: ${{ inputs.workflow || inputs.api-node }}
runs-on: ubuntu-24.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Set up Node.js
uses: actions/setup-node@v4.2.0
with:
node-version-file: api-node/.node-version
cache: npm
cache-dependency-path: api-node/package-lock.json
- name: Install dependencies
working-directory: api-node
run: |
npm ci
- name: Stryker
working-directory: api-node
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
run: |
npm run test:stryker
api-python-test:
name: API - Python | Test
if: ${{ inputs.workflow || inputs.api-python }}
runs-on: ubuntu-24.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
# librdkafka is for confluent-kafka
- name: Install librdkafka
run: |
# https://github.com/confluentinc/librdkafka#build-from-source
wget --no-verbose --output-document=librdkafka.tar.gz https://github.com/edenhill/librdkafka/archive/refs/tags/v2.8.0.tar.gz
tar -x -f librdkafka.tar.gz
rm -f librdkafka.tar.gz
cd librdkafka-2.8.0
./configure
make
sudo make install
sudo ldconfig
cd ..
rm -r -f librdkafka-2.8.0/
- name: Install uv
uses: astral-sh/setup-uv@v5.2.2
with:
version: 0.5.20
enable-cache: true
cache-dependency-glob: api-python/uv.lock
- name: Set up Python
uses: actions/setup-python@v5.4.0
with:
python-version-file: api-python/pyproject.toml
- name: Install dependencies
working-directory: api-python
run: |
uv sync --dev
- name: Test
working-directory: api-python
run: |
uv run poe test-coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5.3.1
with:
directory: api-python
api-rust-test:
name: API - Rust | Test
if: ${{ inputs.workflow || inputs.api-rust }}
runs-on: ubuntu-24.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Install OpenCV
run: |
sudo apt-get update
sudo apt-get install --yes libopencv-dev
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
- name: Install dependencies
working-directory: api-rust
run: |
cargo build
- name: Test
working-directory: api-rust
run: |
cargo test --all-features