Skip to content

Implementation of ADMM-HVA #647

Implementation of ADMM-HVA

Implementation of ADMM-HVA #647

Workflow file for this run

name: test package
on:
push:
branches:
- main
pull_request:
branches:
- main
- develop
jobs:
build:
name: Run tests with pytest
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev,tests]"
- name: Preparation of pytest
run: |
python tests/scripts/download_all.py
- name: Pytest (run all tests including redundant ones)
id: run_redundant
if: startsWith(github.head_ref, 'release/')
run: |
pytest --run-redundant -vvv -n 16 --cov=./ssspy --cov-report=xml tests/package/
- name: Pytest (skip redundant tests)
if: steps.run_redundant.conclusion == 'skipped'
run: |
pytest -vvv -n 16 --cov=./ssspy --cov-report=xml tests/package/
- name: Pytest (regression tests)
run: |
pytest -vvv -n 16 tests/regression/
- name: Upload coverage to codecov
if: matrix.python-version == '3.8' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
lint:
name: Run linters
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[dev]"
- name: Run linters
run: |
# See pyproject.toml
isort --line-length 100 ssspy tests
flake8 --max-line-length=100 --ignore=E203,W503,W504 --exclude ssspy/_version.py ssspy tests
- name: Run formatters
run: |
python -m black --config pyproject.toml --check ssspy tests
upload_package:
needs:
- build
- lint
permissions:
id-token: write
secrets:
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
if: github.event_name == 'pull_request'
uses: ./.github/workflows/upload_package.yaml