Skip to content

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

[pre-commit.ci] pre-commit autoupdate

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

Workflow file for this run

---
name: CI
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
id: setup-py
uses: actions/setup-python@v4
with:
python-version: 3.8.18
- id: python_cache
uses: actions/cache@v4
with:
path: .tenv
key: pip-tenv-${{ steps.setup-py.outputs.python-version }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
pip-tenv-${{ steps.setup-py.outputs.python-version }}-
- name: Create test-venv
if: steps.python_cache.outputs.cache-hit != 'true'
shell: bash
run: |
python -m venv .tenv
- name: Create test-venv
run: |
python3 -m venv .tenv
source .tenv/bin/activate
pip install -U pip build
- name: Install insight
run: |
source .tenv/bin/activate
python -m build --wheel
pip install $(ls dist/*.whl)[db,test] -c requirements.txt --cache-dir .pip-cache
- name: Run unit tests
run: |
source .tenv/bin/activate
pytest -v --junitxml=test-results/junit.xml --cov=insight --cov-report=xml:coverage-reports/cobertura.xml --cov-branch --log-cli-level=INFO
sed -ie 's#/home/runner/work/insight/insight#/github/workspace/src#g' coverage-reports/cobertura.xml
sed -ie 's#.tenv/lib/python3.8/site-packages/##g' coverage-reports/cobertura.xml
sed -ie 's#.tenv.lib.python3.8.site-packages.##g' coverage-reports/cobertura.xml
env:
SYNTHESIZED_KEY: ${{ secrets.SYNTHESIZED_KEY }}
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage-reports/cobertura.xml
- uses: codecov/codecov-action@v3
with:
flags: unittests
files: ./coverage-reports/cobertura.xml
verbose: true
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
with:
projectBaseDir: .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
...