chore(deps): update dependency reuse to v3 #378
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
# SPDX-FileCopyrightText: 2022 Daniele Tentoni <daniele.tentoni.1996@gmail.com | |
# | |
# SPDX-License-Identifier: MIT | |
name: Run Unit Tests | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
workflow_call: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
test: | |
name: Run tests on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python: ["3.10"] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/test.yml') }} | |
- name: Install dependencies | |
run: poetry install | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
- name: Run tests | |
if: matrix.os != 'ubuntu-latest' || matrix.python != '3.10' | |
run: poetry run python -m pytest tests/ | |
- name: Run tests with coverage | |
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.10' | |
run: poetry run python -m pytest --cov-report xml:coverage.xml --cov-report html:cov_html --cov-fail-under=67 --cov=cc_codechecker tests/ | |
- name: Archive code coverage results | |
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.10' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage-report | |
path: | | |
coverage.xml | |
cov_html |