Skip to content

Use correct metric name #460

Use correct metric name

Use correct metric name #460

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@v3.0.2
with:
fetch-depth: 0
- name: Set up Python
id: setup-py
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Cache test venv
uses: actions/cache@v3
with:
path: .pip-cache
key: ${{ runner.os }}-pip-tenv-${{ steps.setup-py.outputs.python-version }}-${{ hashFiles('./pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-tenv-${{ steps.setup-py.outputs.python-version }}
- 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] --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.7/site-packages/##g' coverage-reports/cobertura.xml
sed -ie 's#.tenv.lib.python3.7.site-packages.##g' coverage-reports/cobertura.xml
env:
SYNTHESIZED_KEY: ${{ secrets.SYNTHESIZED_KEY }}
- name: Upload coverage
uses: actions/upload-artifact@v3
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 }}
...