Switch to mkdocs (and use Google style docstrings more consistently) #81
Workflow file for this run
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 (poetry) | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
tests_core: | |
name: "Core, Python ${{ matrix.python-version }}" | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Install poetry | |
run: pipx install poetry==1.5 | |
- name: Configure poetry | |
run: poetry config virtualenvs.in-project true | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache poetry virtualenv | |
uses: actions/cache@v3 | |
with: | |
path: ./.venv | |
key: ${{ runner.os }}-python-${{ matrix.python-version }}-venv-${{ hashFiles('**/poetry.lock') }}-tests_core | |
- name: Install dependencies (without extras) | |
run: poetry install --with dev --no-interaction | |
- name: Test core library with pytest | |
run: poetry run coverage run -m pytest tests --ignore tests/tasks | |
- name: Upload coverage data | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-data | |
path: ".coverage*" | |
tests_tasks: | |
name: "Tasks, Python ${{ matrix.python-version }}" | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Install poetry | |
run: pipx install poetry==1.5 | |
- name: Configure poetry | |
run: poetry config virtualenvs.in-project true | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache poetry virtualenv | |
uses: actions/cache@v3 | |
with: | |
path: ./.venv | |
key: ${{ runner.os }}-python-${{ matrix.python-version }}-venv-${{ hashFiles('**/poetry.lock') }}-tests_tasks | |
- name: Install dependencies (including fractal-tasks extra) | |
run: poetry install --with dev --no-interaction -E fractal-tasks | |
- name: Task-arguments JSON schemas | |
run: poetry run python fractal_tasks_core/dev/check_args_schemas.py | |
- name: Test tasks with pytest | |
run: poetry run coverage run -m pytest tests/tasks | |
- name: Upload coverage data | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-data | |
path: ".coverage*" | |
coverage: | |
name: Coverage | |
runs-on: ubuntu-20.04 | |
needs: [tests_core, tests_tasks] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: python -m pip install --upgrade coverage[toml] | |
- name: Download data | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage-data | |
- name: Add coverage comment to Pull Requests | |
id: coverage_comment | |
uses: py-cov-action/python-coverage-comment-action@v3 | |
with: | |
GITHUB_TOKEN: ${{ github.token }} | |
MERGE_COVERAGE_FILES: true | |
MINIMUM_GREEN: 90 | |
MINIMUM_ORANGE: 60 | |
ANNOTATE_MISSING_LINES: true | |
ANNOTATION_TYPE: notice |