Skip to content

[pre-commit.ci] pre-commit autoupdate #1817

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #1817

name: Run Tests and Upload Coverage Report
on: push
jobs:
test-python-coverage-report:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: |
sudo apt update
sudo apt install python3-pip libsystemd-dev pkg-config -y
rm -f /usr/lib/python3.11/EXTERNALLY-MANAGED
pip3 install -r tests/requirements.txt
- name: Run Python tests and generate coverage report
run: |
pytest --verbose --cov-report term-missing --cov=pt_os_web_portal
coverage xml
- name: Upload Python test coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
flags: python-tests
env_vars: OS,PYTHON
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
test-js-coverage-report:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
# Workaround: At the moment, only lock files in the project root are
# supported...
# https://github.com/actions/setup-node#caching-packages-dependencies
- run: cp frontend/yarn.lock .
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '14'
cache: 'yarn'
# Workaround: undo
- run: rm yarn.lock
- name: Run Node tests
run: |
cd frontend
yarn install
yarn test --coverage
- name: Upload javascript test coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
files: ./frontend/coverage/clover.xml
flags: js-tests
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}