Skip to content

Commit

Permalink
Merge pull request #351 from consideRatio/pr/ci-update
Browse files Browse the repository at this point in the history
ci: update github actions, small refactors, add dependabot for gha
  • Loading branch information
consideRatio authored Nov 3, 2022
2 parents cfa3b3d + 9ce60b2 commit 0bae110
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 50 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# dependabot.yml reference: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
#
# Notes:
# - Status and logs from dependabot are provided at
# https://github.com/jupyterhub/jupyter-server-proxy/network/updates.
# - YAML anchors are not supported here or in GitHub Workflows.
#
version: 2
updates:
# Maintain dependencies in our GitHub Workflows
- package-ecosystem: github-actions
directory: "/" # This should be / rather than .github/workflows
schedule:
interval: weekly
time: "05:00"
timezone: "Etc/UTC"
8 changes: 4 additions & 4 deletions .github/workflows/linkcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ on:

jobs:
linkcheck:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.11"

- name: Install deps
run: pip install -r docs/requirements.txt
Expand Down
40 changes: 24 additions & 16 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@ on:
workflow_dispatch:

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
runs-on: ubuntu-22.04

- uses: actions/setup-python@v2
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: "3.11"

- name: Build dist
run: |
Expand All @@ -58,54 +57,63 @@ jobs:
jlpm pack --filename ../jsdist/jupyterlab-server-proxy-jlpmpack.tgz
- name: Upload Python artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
if-no-files-found: error

- name: Upload Javascript artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: jsdist
path: jsdist
if-no-files-found: error

# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
publish-pypi:
runs-on: ubuntu-22.04
needs:
- build
runs-on: ubuntu-latest

steps:
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Download artifacts from build
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: dist
path: dist

- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.3.0
uses: pypa/gh-action-pypi-publish@v1.5.1
with:
password: ${{ secrets.PYPI_PASSWORD }}

# https://docs.github.com/en/actions/language-and-framework-guides/publishing-nodejs-packages#publishing-packages-to-the-npm-registry
publish-npm:
runs-on: ubuntu-22.04
needs:
- build
runs-on: ubuntu-latest

steps:
# actions/setup-node creates an .npmrc file that references NODE_AUTH_TOKEN
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: 12.x
node-version: 18.x
registry-url: https://registry.npmjs.org

- name: Download artifacts from build
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: jsdist
path: jsdist

- run: npm publish --dry-run ./jsdist/jupyterlab-server-proxy-jlpmpack.tgz

- run: npm publish ./jsdist/jupyterlab-server-proxy-jlpmpack.tgz
if: startsWith(github.ref, 'refs/tags')
env:
Expand Down
37 changes: 18 additions & 19 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,24 @@ on:

jobs:
test:
# FIXME: We need ubutnu-20.04 until firefox and geckowebdriver is available
# in ubuntu-22.04. To check if we can upgrade to ubuntu-22.04, see
# https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#browsers-and-drivers
#
runs-on: ubuntu-20.04

strategy:
# Keep running even if one variation of the job fail
fail-fast: false
matrix:
# We run this job multiple times with different parameterization
# specified below, these parameters have no meaning on their own and
# gain meaning on how job steps use them.
jupyterlab_version: [2, 3]
python: ["3.7", "3.11"]
jupyter_app: [notebook, lab]
jupyterlab-version: ["2", "3"]
python-version: ["3.7", "3.11"]
jupyter-app: [notebook, lab]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python }}"
python-version: "${{ matrix.python-version }}"

- name: Build Python package
id: build-package
Expand All @@ -60,27 +59,27 @@ jobs:
# Pytest options are set in tests/pytest.ini.
run: |
pip install --upgrade pip
pip install jupyter_packaging jupyterlab~=${{ matrix.jupyterlab_version }}.0
pip install jupyter_packaging jupyterlab~=${{ matrix.jupyterlab-version }}.0
pip install ./dist/jupyter_server_proxy-*.whl
pip install pytest pytest-cov pytest-html
# Ensure we don't accidentally depend on notebook
if [ "${{ matrix.jupyter_app }}" == "notebook" ]; then
if [ "${{ matrix.jupyter-app }}" == "notebook" ]; then
pip install "notebook<7"
fi
pip freeze
- name: Run tests
run: |
JUPYTER_TOKEN=secret jupyter-${{ matrix.jupyter_app }} --config=./tests/resources/jupyter_server_config.py &
JUPYTER_TOKEN=secret jupyter-${{ matrix.jupyter-app }} --config=./tests/resources/jupyter_server_config.py &
sleep 5
cd tests
pytest
- name: Upload pytest and coverage reports
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: unit-tests-${{matrix.python }}-${{ matrix.jupyter_app }}-${{matrix.jupyterlab_version}}-${{ github.run_number }}
name: unit-tests-${{matrix.python }}-${{ matrix.jupyter-app }}-${{matrix.jupyterlab-version}}-${{ github.run_number }}
path: |
./build/pytest
./build/coverage
Expand All @@ -97,7 +96,7 @@ jobs:
jupyter server extension list 2>&1 | grep -ie "jupyter_server_proxy.*enabled" -
- name: Install JupyterLab Extension
if: matrix.jupyterlab_version == '2'
if: matrix.jupyterlab-version == '2'
run: |
cd jupyterlab-server-proxy
jupyter labextension install . --no-build --debug
Expand All @@ -120,8 +119,8 @@ jobs:
- name: Upload acceptance test reports
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: acceptance-tests-${{ matrix.python }}-${{ matrix.jupyter_app }}-${{ matrix.jupyterlab_version }}-${{ github.run_number }}
name: acceptance-tests-${{ matrix.python }}-${{ matrix.jupyter-app }}-${{ matrix.jupyterlab-version }}-${{ github.run_number }}
path: |
./build/robot
6 changes: 2 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
version: 2

build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.11"

python:
install:
- requirements: docs/requirements.txt

sphinx:
configuration: docs/conf.py

formats: []
7 changes: 0 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@
# The root toctree document.
root_doc = master_doc = 'index'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
Expand Down

0 comments on commit 0bae110

Please sign in to comment.