Skip to content

Update ci.yml with test report #34

Update ci.yml with test report

Update ci.yml with test report #34

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lints:
name: Run linters
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Cache pre-commit
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install pre-commit
run: pip3 install pre-commit
- name: Run pre-commit checks
run: pre-commit run --all-files --show-diff-on-failure --color always
- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
with:
scan-type: "fs"
ignore-unfixed: true
format: "table"
severity: "CRITICAL,HIGH"
- name: Create venv
run: . ./setup_dev_env.sh
- name: Check licenses
run: ./check_licenses.sh
tests:
name: Run tests
runs-on: ubuntu-latest
container: python:3.11
steps:
- uses: actions/checkout@v2
- name: Cache Dependencies
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Dependencies
run: pip install -r requirements-dev.txt
- name: Run Tests
run: CI=1 pytest -v -p no:warnings --junitxml=report.xml tests/
- name: Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: 'report.xml'
- name: Publish Test Report
uses: actions/upload-artifact@v2
with:
name: Test Report
path: report.xml
retention-days: 10