|
| 1 | +# This is a GitHub workflow defining a set of jobs with a set of steps. |
| 2 | +# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions |
| 3 | +# |
| 4 | +name: Test |
| 5 | + |
| 6 | +on: |
| 7 | + pull_request: |
| 8 | + paths-ignore: |
| 9 | + - "**.md" |
| 10 | + - ".github/workflows/*.yaml" |
| 11 | + - "!.github/workflows/test.yaml" |
| 12 | + push: |
| 13 | + paths-ignore: |
| 14 | + - "**.md" |
| 15 | + - ".github/workflows/*.yaml" |
| 16 | + - "!.github/workflows/test.yaml" |
| 17 | + branches-ignore: |
| 18 | + - "dependabot/**" |
| 19 | + - "pre-commit-ci-update-config" |
| 20 | + tags: ["**"] |
| 21 | + workflow_dispatch: |
| 22 | + |
| 23 | +jobs: |
| 24 | + pytest: |
| 25 | + name: Run pytest |
| 26 | + runs-on: ${{ matrix.runs-on || 'ubuntu-22.04' }} |
| 27 | + |
| 28 | + strategy: |
| 29 | + fail-fast: false |
| 30 | + matrix: |
| 31 | + include: |
| 32 | + # test oldest supported version |
| 33 | + - python-version: "3.6" |
| 34 | + pip-install-spec: "jupyterhub==1.5.1 sqlalchemy==1.*" |
| 35 | + runs-on: ubuntu-20.04 # python 3.6 is only available in 20.04 |
| 36 | + |
| 37 | + - python-version: "3.7" |
| 38 | + pip-install-spec: "jupyterhub==2.* sqlalchemy==1.*" |
| 39 | + - python-version: "3.8" |
| 40 | + pip-install-spec: "jupyterhub==3.*" |
| 41 | + - python-version: "3.10" |
| 42 | + pip-install-spec: "jupyterhub==4.*" |
| 43 | + - python-version: "3.11" |
| 44 | + pip-install-spec: "jupyterhub==4.*" |
| 45 | + |
| 46 | + # test unreleased jupyterhub, failures tolerated |
| 47 | + - python-version: "3.X" |
| 48 | + pip-install-spec: "git+https://github.com/jupyterhub/jupyterhub" |
| 49 | + allow-failure: true |
| 50 | + |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@v3 |
| 53 | + - uses: actions/setup-node@v3 |
| 54 | + with: |
| 55 | + node-version: "18" |
| 56 | + - uses: actions/setup-python@v4 |
| 57 | + with: |
| 58 | + python-version: "${{ matrix.python-version }}" |
| 59 | + |
| 60 | + - name: Install Node dependencies |
| 61 | + run: | |
| 62 | + npm install -g configurable-http-proxy |
| 63 | +
|
| 64 | + - name: Install Python dependencies |
| 65 | + run: | |
| 66 | + pip install --upgrade pip |
| 67 | + pip install ${{ matrix.pip-install-spec }} |
| 68 | + pip install -e ".[test]" |
| 69 | +
|
| 70 | + - name: List dependencies |
| 71 | + run: | |
| 72 | + pip freeze |
| 73 | +
|
| 74 | + - name: pytest |
| 75 | + run: | |
| 76 | + pytest |
| 77 | +
|
| 78 | + # GitHub action reference: https://github.com/codecov/codecov-action |
| 79 | + - uses: codecov/codecov-action@v3 |
0 commit comments