| 1 | # TODO: Line 43, enable pytest --doctest-modules
|
|---|
| 2 |
|
|---|
| 3 | name: Tests
|
|---|
| 4 | on: [push, pull_request]
|
|---|
| 5 | jobs:
|
|---|
| 6 | Tests:
|
|---|
| 7 | strategy:
|
|---|
| 8 | fail-fast: false
|
|---|
| 9 | max-parallel: 15
|
|---|
| 10 | matrix:
|
|---|
| 11 | node: [12.x, 14.x, 16.x]
|
|---|
| 12 | python: ["3.6", "3.8", "3.10"]
|
|---|
| 13 | os: [macos-latest, ubuntu-latest, windows-latest]
|
|---|
| 14 | runs-on: ${{ matrix.os }}
|
|---|
| 15 | steps:
|
|---|
| 16 | - name: Checkout Repository
|
|---|
| 17 | uses: actions/checkout@v2
|
|---|
| 18 | - name: Use Node.js ${{ matrix.node }}
|
|---|
| 19 | uses: actions/setup-node@v2
|
|---|
| 20 | with:
|
|---|
| 21 | node-version: ${{ matrix.node }}
|
|---|
| 22 | - name: Use Python ${{ matrix.python }}
|
|---|
| 23 | uses: actions/setup-python@v2
|
|---|
| 24 | with:
|
|---|
| 25 | python-version: ${{ matrix.python }}
|
|---|
| 26 | env:
|
|---|
| 27 | PYTHON_VERSION: ${{ matrix.python }}
|
|---|
| 28 | - name: Install Dependencies
|
|---|
| 29 | run: |
|
|---|
| 30 | npm install --no-progress
|
|---|
| 31 | pip install flake8 pytest
|
|---|
| 32 | - name: Set Windows environment
|
|---|
| 33 | if: matrix.os == 'windows-latest'
|
|---|
| 34 | run: |
|
|---|
| 35 | echo 'GYP_MSVS_VERSION=2015' >> $Env:GITHUB_ENV
|
|---|
| 36 | echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV
|
|---|
| 37 | - name: Lint Python
|
|---|
| 38 | if: matrix.os == 'ubuntu-latest'
|
|---|
| 39 | run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics
|
|---|
| 40 | - name: Run Python tests
|
|---|
| 41 | run: python -m pytest
|
|---|
| 42 | # - name: Run doctests with pytest
|
|---|
| 43 | # run: python -m pytest --doctest-modules
|
|---|
| 44 | - name: Run Node tests
|
|---|
| 45 | run: npm test
|
|---|