docs: simplify few CLI examples #15
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: Django Unit Tests | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
django-unit-tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
centos-stream: [8, 9] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Install packages required for unit tests | |
run: | | |
pip3 install podman-compose | |
- name: Checkout Git Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Checkout Kobo Git Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
path: kobo | |
repository: release-engineering/kobo | |
- name: Run unit tests | |
run: | | |
CENTOS_RELEASE='${{matrix.centos-stream}}' containers/scripts/init-db.sh --force --minimal | |
podman exec -it osh-hub /usr/bin/coverage-3 run --omit="*site-packages*,*kobo*," --rcfile=/coveragerc osh/hub/manage.py test -v 3 || exit 1 | |
# Generate xml report to be uploaded to codecov | |
podman exec -it osh-hub /usr/bin/coverage-3 xml --rcfile=/coveragerc -o /cov/coverage.xml | |
podman cp osh-hub:/cov/coverage.xml . | |
- name: Show logs | |
if: always() | |
run: | | |
podman logs db | |
podman logs osh-hub | |
podman logs osh-worker | |
- name: "Upload Django Unit Tests Coverage to Codecov" | |
uses: codecov/codecov-action@v3 | |
with: | |
name: "Archive Django Unit Tests Coverage" | |
files: coverage.xml | |
fail_ci_if_error: false | |
verbose: true |