Try to defer aiida imports where not used #214
Workflow file for this run
This file contains hidden or 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: | |
- main | |
env: | |
PYTEST_ADDOPTS: "--color=yes" | |
# Cancel running workflows when additional changes are pushed | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
linting: | |
name: Lint the `optimade-maker` package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Set up uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
version: "0.8.x" | |
enable-cache: true | |
- name: Install latest compatible versions of immediate dependencies | |
run: | | |
uv sync --locked --all-extras --dev | |
- name: Run linters | |
run: | | |
uv run pre-commit run --all-files --show-diff-on-failure | |
tests: | |
name: Test the `optimade-maker` package | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "${{ matrix.python-version }}" | |
- name: Set up uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
version: "0.8.x" | |
enable-cache: true | |
- name: Install latest compatible versions of immediate dependencies | |
run: | | |
uv sync --locked --all-extras --dev | |
- name: Run tests | |
run: | | |
uv run pytest -vv --cov=./src/optimade_maker --cov-report=xml --cov-report=term ./tests | |
- name: Reinstall environment without aiida | |
run: | | |
uv sync --locked --extra core --extra test | |
- name: Rerun tests without aiida | |
run: | | |
uv run pytest -vv --cov=./src/optimade_maker --cov-report=xml --cov-report=term ./tests --ignore=./tests/aiida | |
- name: Upload coverage | |
uses: codecov/codecov-action@v3 | |
if: matrix.python-version == '3.10' | |
with: | |
name: project | |
file: ./coverage.xml | |
flags: project |