[pre-commit.ci] pre-commit autoupdate #1027
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
name: CI - Tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- 'master' | |
- 'push-action/**' # Allow pushing to protected branches (using CasperWA/push-protected) | |
jobs: | |
basic-tests: | |
name: External | |
uses: SINTEF/ci-cd/.github/workflows/[email protected] | |
with: | |
## General settings: | |
install_extras: "[dev]" | |
## pre-commit | |
run_pre-commit: false | |
## pylint & safety | |
python_version_pylint_safety: "3.9" | |
# pylint-specific settings | |
run_pylint: false | |
# safety-specific settings | |
run_safety: true | |
# 48547: RDFLib vulnerability: https://pyup.io/vulnerabilities/PVE-2022-48547/48547/ | |
# 44715-44717: NumPy vulnerabilities: | |
# https://pyup.io/vulnerabilities/CVE-2021-41495/44715/ | |
# https://pyup.io/vulnerabilities/CVE-2021-41496/44716/ | |
# https://pyup.io/vulnerabilities/CVE-2021-34141/44717/ | |
# 70612: Jinja2 vulnerability. Only used as subdependency for mkdocs++ in oteapi-dlite. | |
# https://data.safetycli.com/v/70612/97c/ | |
safety_options: | | |
--ignore=48547 | |
--ignore=44715 | |
--ignore=44716 | |
--ignore=44717 | |
--ignore=70612 | |
## Build package | |
run_build_package: true | |
python_version_package: "3.9" | |
build_libs: flit | |
build_cmd: flit build | |
## Build documentation | |
run_build_docs: true | |
python_version_docs: "3.9" | |
warnings_as_errors: true | |
use_mkdocs: true | |
# mkdocs-specific settings | |
update_python_api_ref: true | |
update_docs_landing_page: true | |
package_dirs: oteapi_dlite | |
full_docs_dirs: | | |
models | |
strategies | |
landing_page_replacements: | | |
(LICENSE),(LICENSE.md) | |
https://EMMC-ASBL.github.io/oteapi-dlite/latest/, | |
all_strategies),all_strategies.md) | |
pytest-linux: | |
name: pytest (linux-py${{ matrix.python-version }}) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- name: Checkout oteapi-dlite | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt install graphviz | |
python -m pip install -U pip | |
pip install -U setuptools wheel flit | |
pip install -e .[testing] | |
- name: List installed packages | |
run: pip freeze | |
- name: Test with pytest | |
run: pytest -vvv --cov-report=xml --doctest-modules | |
- name: Upload coverage to Codecov | |
if: matrix.python-version == '3.9' && github.repository == 'EMMC-ASBL/oteapi-dlite' | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
pytest-win: | |
name: pytest (windows-py${{ matrix.python-version }}) | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version}} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version}} | |
- name: Install system dependencies | |
run: | | |
$url = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9550/gs9550w64.exe" | |
$outpath = "${{ github.workspace }}\ghostscript.exe" | |
Invoke-WebRequest -Uri $url -OutFile $outpath | |
$args = @("/S") | |
Start-Process -Filepath $outpath -ArgumentList $args | |
shell: powershell | |
- name: Install Python dependencies | |
run: | | |
python -m pip install -U pip | |
pip install -U setuptools wheel | |
pip install -e .[testing] | |
- name: Test with pytest | |
run: | | |
pytest -vvv --cov-report=xml --cov=oteapi --durations=10 | |
pytest --cov-report=xml:strategies.xml --cov=oteapi/strategies --durations=10 | |
- name: Upload coverage to Codecov | |
if: matrix.python-version == '3.9' && github.repository == 'EMMC-ASBL/oteapi-core' | |
uses: codecov/codecov-action@v5 | |
with: | |
files: coverage.xml | |
flags: windows | |
- name: Upload strategies coverage to Codecov | |
if: matrix.python-version == '3.9' && github.repository == 'EMMC-ASBL/oteapi-core' | |
uses: codecov/codecov-action@v5 | |
with: | |
files: strategies.xml | |
flags: windows-strategies |