Skip to content

Commit 1ad0318

Browse files
committed
Change types of parametrization and avoid starting php if possible
1 parent 65fc6de commit 1ad0318

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

.github/workflows/tests.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
tests:
1616
strategy:
1717
matrix:
18-
php: ["not php_api", "php_api"]
19-
mutations: ["not mut", "mut"]
18+
php_api: [true, false]
19+
mutations: [true, false]
2020
runs-on: ubuntu-latest
2121
steps:
2222
- uses: actions/checkout@v6
@@ -25,9 +25,20 @@ jobs:
2525
python-version: 3.x
2626

2727
# https://github.com/docker/compose/issues/10596
28-
- run: docker compose --profile "python" --profile "php" up --detach --wait --remove-orphans || exit $(docker compose ps -q | xargs docker inspect -f '{{.State.ExitCode}}' | grep -v '^0' | wc -l)
29-
- run: docker exec openml-python-rest-api coverage run -m pytest -n auto -v -m "${{ matrix.php }} and ${{ matrix.mutations }}"
30-
- run: docker exec openml-python-rest-api coverage xml
28+
- name: Start services
29+
run: |
30+
profiles="--profile python"
31+
if [ "${{ matrix.php_api }}" = "true" ]; then
32+
profiles="$profiles --profile php"
33+
fi
34+
docker compose $profiles up --detach --wait --remove-orphans || exit $(docker compose ps -q | xargs docker inspect -f '{{.State.ExitCode}}' | grep -v '^0' | wc -l)
35+
36+
- name: Run tests
37+
run: |
38+
marker="${{ matrix.php_api == true && 'php_api' || 'not php_api' }} and ${{ matrix.mutations == true && 'mut' || 'not mut' }}"
39+
docker exec openml-python-rest-api coverage run -m pytest -n auto -v -m "$marker"
40+
- name: Produce coverage report
41+
run: docker exec openml-python-rest-api coverage xml
3142
- name: Upload results to Codecov
3243
uses: codecov/codecov-action@v4
3344
with:

0 commit comments

Comments
 (0)