|
1 | 1 | # This is a GitHub workflow defining a set of jobs with a set of steps. |
2 | | -# ref: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions |
| 2 | +# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions |
3 | 3 | # |
4 | 4 | name: Test |
5 | 5 |
|
6 | 6 | on: |
7 | 7 | pull_request: |
8 | 8 | paths-ignore: |
9 | 9 | - "**.md" |
10 | | - - "**.yml" |
11 | | - - "**.yaml" |
12 | | - - "!.github/workflows/test.yml" |
| 10 | + - ".github/workflows/*.yaml" |
| 11 | + - "!.github/workflows/test.yaml" |
13 | 12 | push: |
14 | 13 | paths-ignore: |
15 | 14 | - "**.md" |
16 | | - - "**.yml" |
17 | | - - "**.yaml" |
18 | | - - "!.github/workflows/test.yml" |
| 15 | + - ".github/workflows/*.yaml" |
| 16 | + - "!.github/workflows/test.yaml" |
19 | 17 | branches-ignore: |
20 | 18 | - "dependabot/**" |
21 | 19 | - "pre-commit-ci-update-config" |
|
24 | 22 |
|
25 | 23 | jobs: |
26 | 24 | pytest: |
27 | | - name: "Run pytest" |
28 | | - runs-on: ubuntu-20.04 |
29 | | - continue-on-error: ${{ matrix.allow_failure }} |
| 25 | + name: Run pytest |
| 26 | + runs-on: ubuntu-22.04 |
| 27 | + |
30 | 28 | strategy: |
31 | | - # Keep running even if one variation of the job fail |
32 | 29 | fail-fast: false |
33 | 30 | matrix: |
34 | | - python-version: |
35 | | - - "3.6" |
36 | | - - "3.10" |
37 | | - JHUB_VER: |
38 | | - - "1.0.0" |
39 | | - - "1.5.1" |
40 | | - - "2.3.1" |
41 | | - allow_failure: [false] |
42 | | - |
43 | | - exclude: |
44 | | - # JupyterHub 1.3.0 requires python 3.6+ |
45 | | - - JHUB_VER: "1.3.0" |
46 | | - python-version: "3.5" |
47 | | - # JupyterHub 0.9.6 used a deprecated sqlalchemy feature removed in py3.9 environment |
48 | | - - JHUB_VER: "0.9.6" |
49 | | - python-version: "3.9" |
50 | 31 | include: |
51 | | - - JHUB_VER: "main" |
52 | | - python-version: "3.9" |
53 | | - allow_failure: true |
54 | | - - JHUB_VER: "3.0.0" |
55 | | - python-version: "3.9" |
56 | | - allow_failure: true |
| 32 | + # test oldest supported version |
| 33 | + - python-version: "3.7" |
| 34 | + pip-install-spec: "jupyterhub==1.5.1 sqlalchemy==1.*" |
| 35 | + |
| 36 | + - python-version: "3.8" |
| 37 | + pip-install-spec: "jupyterhub==2.* sqlalchemy==1.*" |
| 38 | + - python-version: "3.10" |
| 39 | + pip-install-spec: "jupyterhub==3.*" |
| 40 | + - python-version: "3.11" |
| 41 | + pip-install-spec: "jupyterhub==4.*" |
| 42 | + |
| 43 | + # test unreleased jupyterhub, failures tolerated |
| 44 | + - python-version: "3.X" |
| 45 | + pip-install-spec: "git+https://github.com/jupyterhub/jupyterhub" |
| 46 | + allow-failure: true |
57 | 47 |
|
58 | 48 | steps: |
59 | 49 | - uses: actions/checkout@v3 |
60 | | - - name: Set up Python ${{ matrix.python-version }} |
61 | | - uses: actions/setup-python@v3 |
| 50 | + - uses: actions/setup-node@v3 |
| 51 | + with: |
| 52 | + node-version: "18" |
| 53 | + - uses: actions/setup-python@v4 |
62 | 54 | with: |
63 | 55 | python-version: "${{ matrix.python-version }}" |
64 | 56 |
|
65 | | - - name: Install dependencies |
| 57 | + - name: Install Node dependencies |
66 | 58 | run: | |
67 | | - python -m pip install --upgrade pip |
68 | | - python -m pip install pytest |
69 | | - pip install -r requirements.txt |
70 | | - pip list |
| 59 | + npm install -g configurable-http-proxy |
71 | 60 |
|
72 | | - - name: Install nodejs dependencies |
| 61 | + - name: Install Python dependencies |
73 | 62 | run: | |
74 | | - sudo npm install -g configurable-http-proxy |
| 63 | + pip install --upgrade pip |
| 64 | + pip install ${{ matrix.pip-install-spec }} |
| 65 | + pip install -e ".[test]" |
75 | 66 |
|
76 | | - # We need to check compatibility with different versions of the JH API, |
77 | | - # including latest development. For that, we also need to pull in the |
78 | | - # development dependencies of that old JH version (but we don't need |
79 | | - # conda/npm for our tests). |
80 | | - - name: install JupyterHub |
| 67 | + - name: List dependencies |
81 | 68 | run: | |
82 | | - git clone --quiet --branch ${{ matrix.JHUB_VER }} https://github.com/jupyterhub/jupyterhub.git ./jupyterhub |
83 | | - pip install -r ./jupyterhub/dev-requirements.txt |
84 | | - pip install ./jupyterhub |
| 69 | + pip freeze |
85 | 70 |
|
86 | 71 | - name: pytest |
87 | 72 | run: | |
88 | 73 | pytest --verbose --color=yes --last-failed --cov batchspawner batchspawner/tests |
| 74 | +
|
| 75 | + # GitHub action reference: https://github.com/codecov/codecov-action |
| 76 | + - uses: codecov/codecov-action@v3 |
0 commit comments