-
-
Notifications
You must be signed in to change notification settings - Fork 49
47 lines (45 loc) · 1.46 KB
/
Copy pathtests.yml
File metadata and controls
47 lines (45 loc) · 1.46 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
name: Tests
on:
push:
branches:
- main
pull_request:
paths:
- 'src/**'
- 'tests/**'
- 'docker/**'
- 'docker-compose.yaml'
- 'pyproject.toml'
- '.github/workflows/tests.yml'
permissions:
contents: write
jobs:
tests:
name: "${{ matrix.php_api == true && 'Migration' || 'Python-only' }} ${{ matrix.mutations == true && 'with mutations' || 'read-only' }}"
strategy:
matrix:
php_api: [true, false]
mutations: [true, false]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: 3.x
- name: Start services
run: |
services="python-api"
if [ "${{ matrix.php_api }}" = "true" ]; then
sed -i 's/INDEX_ES_DURING_STARTUP=false/INDEX_ES_DURING_STARTUP=true/' docker/php/.env
services="$services php-api"
fi
docker compose up $services --detach --wait --remove-orphans
- name: Run tests
run: |
marker="${{ matrix.php_api == true && 'php_api' || 'not php_api' }} and ${{ matrix.mutations == true && 'mut' || 'not mut' }}"
jobs="${{ matrix.mutations == true && '1' || 'auto' }}"
docker compose exec python-api pytest -n "$jobs" -v -m "$marker" --cov --cov-report=xml
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}