Skip to content

Moving mypy to its own job. #20

Moving mypy to its own job.

Moving mypy to its own job. #20

Workflow file for this run

name: PyLECO CI
on:
push:
branches:
- main
pull_request:
jobs:
docs_lint:
name: Docs and Linting
runs-on: "ubuntu-latest"
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install pyleco requirements
uses: mamba-org/setup-micromamba@v1
with:
python-version: "3.10"
environment-file: environment.yml
cache-environment-key: py3.10-ubuntu-latest-mamba-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}
cache-downloads: false
- name: Lint with ruff
uses: chartboost/ruff-action@v1
with:
args: --extend-select=E9,F63,F7,F82 --show-source
- uses: ammaraskar/sphinx-problem-matcher@master
- name: Generate docs
if: always() # run even if the previous step failed
working-directory: ./docs
run: |
echo "::add-matcher::.github/sphinx.json"
make html SPHINXOPTS="-W --keep-going"
- name: Run doctests
if: always() # run even if the previous step failed
working-directory: ./docs
run: |
echo "::add-matcher::.github/sphinx.json"
make doctest SPHINXOPTS="-W --keep-going"
type_checking:
name: Static Type Checking
runs-on: "ubuntu-latest"
defaults:
run:
shell: bash -l {0}
steps:
-uses: actions/checkout@v3
with:

Check failure on line 51 in .github/workflows/pyleco_CI.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/pyleco_CI.yml

Invalid workflow file

You have an error in your yaml syntax on line 51
fetch-depth: 0
- name: Install pyleco requirements
uses: mamba-org/setup-micromamba@v1
with:
python-version: "3.10"
environment-file: environment.yml
cache-environment-key: py3.10-ubuntu-latest-mamba-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}
cache-downloads: false
- name: Install mypy
run: pip install mypy
- name: Run mypy
uses: sasanquaneuf/mypy-github-action@releases/v1
with:
checkName: 'type_checking' # NOTE: this needs to be the same as the job name
test:
name: Python ${{ matrix.python-version }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.10", "3.11"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install pyleco requirements
uses: mamba-org/setup-micromamba@v1
with:
python-version: "3.10"
environment-file: environment.yml
cache-environment-key: py3.10-ubuntu-latest-mamba-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}
cache-downloads: false
- name: Install Pyleco
# If the pytest problem matcher stops working because of bad paths, do an editable install
run: pip install .[dev]
- name: Pyleco version
run: python -c "import pyleco;print(pyleco.__version__)"
- name: Run pytest with xvfb
if: runner.os == 'Linux'
run: |
echo "::add-matcher::.github/pytest.json"
xvfb-run -a pytest
- name: Run pytest
if: runner.os != 'Linux'
run: |
echo "::add-matcher::.github/pytest.json"
pytest