Skip to content

Update lint

Update lint #57

Workflow file for this run

name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
# Run tests, linters, and checkers via nox
test:
runs-on: ${{ matrix.platform }}
env:
LEDA_TEST_OUTPUT_DIR: ~/leda_outputs/
strategy:
fail-fast: false
matrix:
# See https://help.github.com/articles/virtual-environments-for-github-actions
platform:
- ubuntu-latest
- macos-latest
- windows-latest
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy-3.8']
steps:
- name: Check out code
uses: actions/checkout@v3
- 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 setuptools pip wheel
python -m pip install nox
- name: Test with nox
run: nox
if: ${{ (matrix.python-version != '3.7') }}
# Skip type checkers on py3.7 because those package versions
# yield different results
- name: Test with nox (py3.7)
run: nox -s black pytest ruff
if: ${{ matrix.python-version == '3.7' }}
- name: Integration test with nox
run: nox -t integration_test --python {{ matrix.python-version }}
# Skip integration tests on Windows/py3.8 because
# there are no pre-built Windows/py3.8/numpy1.6.6 wheels.
# TODO: Skip integration tests on pypy; investigate issues
if: |

Check failure on line 59 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / Test

Invalid workflow file

The workflow is not valid. .github/workflows/test.yml (Line: 59, Col: 13): Unexpected symbol: '\'. Located at position 75 within expression: ! (matrix.platform == 'windows-latest' && matrix.python-version == '3.8') \ && ! startsWith(matrix.python-version, 'pypy-')
${{ ! (matrix.platform == 'windows-latest' && matrix.python-version == '3.8') \
&& ! startsWith(matrix.python-version, 'pypy-') }}
- name: Upload failed outputs
uses: actions/upload-artifact@v3
with:
name: leda-outputs-${{ matrix.platform }}-${{ matrix.python-version }}
path: ~/leda_outputs/
retention-days: 1
if: ${{ failure() }}
# Test building and publishing
# See:
# - https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
# - https://packaging.python.org/en/latest/tutorials/packaging-projects/
# - https://www.seanh.cc/2022/05/21/publishing-python-packages-from-github-actions/
publish-test:
runs-on: ubuntu-latest
needs: [test]
strategy:
matrix:
python-version: ['3.8']
steps:
- uses: actions/checkout@v3
with:
# See https://github.com/actions/checkout/issues/261
ref: ${{ github.event.pull_request.head.sha }}
# Grab entire history for setuptools_scm
fetch-depth: 0
- 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 build twine
- name: Create packages
run: python -m build
- name: Run twine check
run: twine check dist/*