Skip to content

Update ROADMAP.

Update ROADMAP. #11

Workflow file for this run

name: CI
on:
push:
pull_request:
workflow_call:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Setup
id: setup
uses: ./.github/actions/setup
with:
setup-pre-commit: true
cache-python: true
install-options: --only lint --all-extras --sync
# for some reason poetry won't install the extras
- name: Install extras
run: poetry install --all-extras
# Run pre-commit hooks
- name: Run pre-commit hooks
run: pre-commit run --all-files
# Run mypy since it cannot check imports in pre-commit hooks
- name: Run linters
run: make lint
# Determine files changed by pre-commit hooks
- name: Determine files changed by pre-commit hooks
id: changed-files
if: ${{ failure() }}
run: echo files=$(git diff --name-only --diff-filter=AM) >> "$GITHUB_OUTPUT"
# Upload changed files on pre-commit error
- name: Upload changed files
if: ${{ failure() && steps.changed-files.outputs.files }}
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: Files modified by pre-commit
path: ${{ steps.changed-files.outputs.files }}
generate_test_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: setup python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: "3.11"
- name: Extract extras from `pyproject.toml`
id: set-matrix
shell: python
run: |
import tomllib
import os
import json
with open('pyproject.toml', 'rb') as f:
manifest = tomllib.load(f)
yaml = { 'include' : [{ 'extras' : extra} for extra in [''] + list(manifest['tool']['poetry']['extras'])]}
yaml['include'].append({'extras': 'all'})
out = json.dumps(yaml)
print(out)
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
f.write('matrix=' + out)
test:
name: test ${{ matrix.extras && 'with' || '' }} ${{ matrix.extras }}
runs-on: ubuntu-latest
needs: generate_test_matrix
strategy:
matrix: ${{ fromJson(needs.generate_test_matrix.outputs.matrix) }}
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Setup
id: setup
uses: ./.github/actions/setup
with:
install-options: --only test --sync ${{ matrix.extras && ( matrix.extras == 'all' && '--all-extras' || format('--extras "{0}"', matrix.extras)) || '' }}
- name: Run Tests
run: make test
# Upload summary of test results
- uses: test-summary/[email protected]
if: failure() || success()
with:
paths: report.xml
# Upload coverage to job summary
- name: Summarize coverage
uses: livewing/lcov-job-summary@0a9952db27f98def2ba2de3189c6b24acc4c5501 # v1.1.0
if: matrix.extras == 'all' && (failure() || success())
with:
lcov: coverage.lcov
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Setup
id: setup
uses: ./.github/actions/setup
with:
cache-python: true
install-options: --only docs --sync
- name: Build Docs
run: make docs
# Upload build
- name: Upload build
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: Docs
path: docs/build