Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #407 from minrk/gha
Switch CI to GitHub actions
- Loading branch information
Showing
42 changed files
with
477 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[flake8] | ||
# Ignore style and complexity | ||
# E: style errors | ||
# W: style warnings | ||
# C: complexity | ||
# F401: module imported but unused | ||
# F403: import * | ||
# F811: redefinition of unused `name` from line `N` | ||
# F841: local variable assigned but never used | ||
# E402: module level import not at top of file | ||
# I100: Import statements are in the wrong order | ||
# I101: Imported names are in the wrong order. Should be | ||
ignore = E, C, W, F401, F403, F811, F841, E402, I100, I101, D400 | ||
builtins = c, get_config | ||
exclude = | ||
.cache, | ||
docs, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Build releases and (on tags) publish to PyPI | ||
name: Release | ||
|
||
# always build releases (to make sure wheel-building works) | ||
# but only publish to PyPI on tags | ||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build-release: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: install build package | ||
run: | | ||
pip install --upgrade pip | ||
pip install build | ||
pip freeze | ||
- name: build release | ||
run: | | ||
python -m build --sdist --wheel . | ||
ls -l dist | ||
- name: publish to pypi | ||
uses: pypa/gh-action-pypi-publish@v1.4.1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
# This is a GitHub workflow defining a set of jobs with a set of steps. | ||
# ref: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions | ||
# | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 2 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- uses: pre-commit/action@v2.0.0 | ||
|
||
# Run tests | ||
test: | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 10 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- python: 3.8 | ||
test: internal-ssl | ||
- python: 3.6 | ||
jupyterhub: "1.0" | ||
- python: 3.7 | ||
jupyterhub: 1.1 | ||
- python: 3.8 | ||
jupyterhub: 1.2 | ||
- python: 3.9 | ||
jupyterhub: 1.3 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: setup docker swarm | ||
run: docker swarm init | ||
|
||
- name: Install Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
# preserve pip cache to speed up installation | ||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
# Look to see if there is a cache hit for the corresponding requirements file | ||
key: ${{ runner.os }}-pip-${{ hashFiles('*requirements.txt') }} | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install --upgrade --pre -r dev-requirements.txt | ||
if [[ ! -z "${{ matrix.jupyterhub }}" ]]; then | ||
pip install jupyterhub==${{ matrix.jupyterhub }}.* | ||
fi | ||
pip install -e . | ||
pip freeze | ||
- name: Install Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: "14" | ||
|
||
- name: Install Node dependencies | ||
run: | | ||
npm install -g configurable-http-proxy | ||
- name: Pull images | ||
run: | | ||
for v in 1.0 1.1 1.2 1.3; do | ||
docker pull jupyterhub/singleuser:$v | ||
# preserve the layers with a different tag | ||
docker tag jupyterhub/singleuser:$v jupyterhub/singleuser:${v}-cache | ||
# untag so that pull actions are still required | ||
docker rmi jupyterhub/singleuser:$v | ||
done | ||
- name: Run tests | ||
if: matrix.test != 'internal-ssl' | ||
run: | | ||
py.test --cov dockerspawner tests -v | ||
- name: Run internal-ssl tests | ||
if: matrix.test == 'internal-ssl' | ||
run: | | ||
cd examples/internal-ssl | ||
pytest -vsx | ||
- name: Submit codecov report | ||
run: | | ||
codecov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
repos: | ||
- repo: https://github.com/asottile/reorder_python_imports | ||
rev: v1.9.0 | ||
hooks: | ||
- id: reorder-python-imports | ||
# autoformat: Python | ||
- repo: https://github.com/psf/black | ||
rev: 20.8b1 | ||
hooks: | ||
- id: black | ||
# Autoformat: shell scripts | ||
- repo: https://github.com/lovesegfault/beautysh | ||
rev: 6.0.1 | ||
hooks: | ||
- id: beautysh | ||
# Autoformat: markdown, yaml | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v2.2.1 | ||
hooks: | ||
- id: prettier | ||
# code-correctess | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: "3.8.4" | ||
hooks: | ||
- id: flake8 | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.4.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: check-case-conflict | ||
- id: check-executables-have-shebangs | ||
- id: requirements-txt-fixer |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
codecov | ||
notebook | ||
pyflakes | ||
pytest>=3.6 | ||
pytest-cov | ||
pytest-asyncio | ||
pyflakes | ||
notebook | ||
pytest-cov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.