Trigger CI #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: ["main", "master", "develop"] | |
pull_request: | |
branches: ["main", "master", "develop"] | |
permissions: | |
contents: read | |
pull-requests: write | |
issues: write | |
jobs: | |
unit-test-with-pytest: | |
strategy: | |
matrix: | |
test-type: ["unit", "e2e"] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Bootstrap | |
uses: ./.github/actions/bootstrap | |
- name: Exports all Github Environment Secrets | |
uses: oNaiPs/secrets-to-env-action@v1 | |
with: | |
secrets: ${{ toJSON(secrets) }} | |
- name: Exports all Github Environment Variables | |
uses: oNaiPs/secrets-to-env-action@v1 | |
with: | |
secrets: ${{ toJSON(vars) }} | |
- name: Prepare reports directory | |
run: | | |
mkdir -p reports | |
touch reports/pytest-${{ matrix.test-type }}.txt | |
touch reports/pytest-coverage-${{ matrix.test-type }}.txt | |
- name: Run tests with pytest and generate reports | |
run: | | |
# make sure pipe propogates exit code to fail on test failure | |
set -o pipefail | |
pytest --junitxml=reports/pytest-${{ matrix.test-type }}.xml --cov-report=term-missing:skip-covered --cov=server tests/${{ matrix.test-type }}/ | tee reports/pytest-coverage-${{ matrix.test-type }}.txt | |
set +o pipefail | |
- name: Pytest coverage comment | |
uses: MishaKav/pytest-coverage-comment@main | |
with: | |
title: Coverage for ${{ matrix.test-type }} tests | |
create-new-comment: true | |
pytest-coverage-path: reports/pytest-coverage-${{ matrix.test-type }}.txt | |
junitxml-path: reports/pytest-${{ matrix.test-type }}.xml |