|
| 1 | +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
| 2 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
| 3 | + |
| 4 | +name: Python package |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + pull_request: |
| 9 | + schedule: |
| 10 | + - cron: "0 8 * * *" |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: >- |
| 14 | + ${{ github.workflow }}- |
| 15 | + ${{ github.ref_type }}- |
| 16 | + ${{ github.event.pull_request.number || github.sha }} |
| 17 | + cancel-in-progress: true |
| 18 | + |
| 19 | +jobs: |
| 20 | + build: |
| 21 | + runs-on: ${{ matrix.os }} |
| 22 | + strategy: |
| 23 | + fail-fast: false |
| 24 | + matrix: |
| 25 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 26 | + python-version: ["3.7", "3.10"] |
| 27 | + include: |
| 28 | + - os: windows-latest |
| 29 | + python-version: "3.9" |
| 30 | + - os: ubuntu-latest |
| 31 | + python-version: "pypy-3.8" |
| 32 | + - os: macos-latest |
| 33 | + python-version: "3.8" |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v2 |
| 36 | + - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 |
| 37 | + - name: Install dependencies |
| 38 | + run: | |
| 39 | + pip install -e ".[test]" |
| 40 | + - name: Test with pytest |
| 41 | + run: | |
| 42 | + python -m pytest -vv --timeout 60 --cov jupyter_core --cov-report term-missing:skip-covered |
| 43 | + - name: Check CLI |
| 44 | + run: | |
| 45 | + cd $HOME |
| 46 | + jupyter troubleshoot |
| 47 | +
|
| 48 | + test_miniumum_versions: |
| 49 | + name: Test Minimum Versions |
| 50 | + runs-on: ubuntu-latest |
| 51 | + timeout-minutes: 10 |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v2 |
| 54 | + - name: Base Setup |
| 55 | + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 |
| 56 | + with: |
| 57 | + python_version: "3.7" |
| 58 | + - name: Install miniumum versions |
| 59 | + uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1 |
| 60 | + - name: Run the unit tests |
| 61 | + run: pytest -vv -W default || pytest -vv -W default --lf |
| 62 | + |
| 63 | + test_prereleases: |
| 64 | + name: Test Prereleases |
| 65 | + timeout-minutes: 10 |
| 66 | + runs-on: ubuntu-latest |
| 67 | + steps: |
| 68 | + - name: Checkout |
| 69 | + uses: actions/checkout@v2 |
| 70 | + - name: Base Setup |
| 71 | + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 |
| 72 | + - name: Install the Python dependencies |
| 73 | + run: | |
| 74 | + pip install --upgrade --upgrade-strategy eager --pre -e ".[test]" |
| 75 | + - name: List installed packages |
| 76 | + run: | |
| 77 | + pip freeze |
| 78 | + pip check |
| 79 | + - name: Run the tests |
| 80 | + run: | |
| 81 | + pytest -vv || pytest -vv --lf |
| 82 | +
|
| 83 | + make_sdist: |
| 84 | + name: Make SDist |
| 85 | + runs-on: ubuntu-latest |
| 86 | + timeout-minutes: 10 |
| 87 | + steps: |
| 88 | + - uses: actions/checkout@v2 |
| 89 | + - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 |
| 90 | + - uses: jupyterlab/maintainer-tools/.github/actions/make-sdist@v1 |
| 91 | + |
| 92 | + test_sdist: |
| 93 | + runs-on: ubuntu-latest |
| 94 | + needs: [make_sdist] |
| 95 | + name: Install from SDist and Test |
| 96 | + timeout-minutes: 20 |
| 97 | + steps: |
| 98 | + - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 |
| 99 | + - uses: jupyterlab/maintainer-tools/.github/actions/test-sdist@v1 |
| 100 | + |
| 101 | + pre-commit: |
| 102 | + name: pre-commit |
| 103 | + runs-on: ubuntu-latest |
| 104 | + steps: |
| 105 | + - uses: actions/checkout@v2 |
| 106 | + - uses: actions/setup-python@v2 |
| 107 | + - uses: pre-commit/[email protected] |
| 108 | + with: |
| 109 | + extra_args: --all-files --hook-stage=manual |
| 110 | + - name: Help message if pre-commit fail |
| 111 | + if: ${{ failure() }} |
| 112 | + run: | |
| 113 | + echo "You can install pre-commit hooks to automatically run formatting" |
| 114 | + echo "on each commit with:" |
| 115 | + echo " pre-commit install" |
| 116 | + echo "or you can run by hand on staged files with" |
| 117 | + echo " pre-commit run" |
| 118 | + echo "or after-the-fact on already committed files with" |
| 119 | + echo " pre-commit run --all-files --hook-stage=manual" |
0 commit comments