mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Add GHA unit test
This commit is contained in:
36
.github/workflows/unit-test.yaml
vendored
Normal file
36
.github/workflows/unit-test.yaml
vendored
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
unit-test:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
container: ubuntu:18.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.6
|
||||||
|
- name: Install and setup venv
|
||||||
|
run: |
|
||||||
|
apt-get update --yes && apt-get install --yes python3-venv
|
||||||
|
python3 -m venv /srv/venv
|
||||||
|
echo '/srv/venv/bin' >> $GITHUB_PATH
|
||||||
|
- name: Cache pip deps
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: /srv/venv/
|
||||||
|
key: ${{ runner.os }}-pip-dependencies-${{ hashFiles('*setup.py', '*dev-requirements.txt') }}
|
||||||
|
- name: Install Python dependencies
|
||||||
|
run: |
|
||||||
|
python3 -m pip install -U pip==20.0.*
|
||||||
|
python3 -m pip install -r dev-requirements.txt
|
||||||
|
python3 -m pip install -e .
|
||||||
|
pip freeze
|
||||||
|
- name: Run unit tests
|
||||||
|
run: |
|
||||||
|
pytest --cov=tljh tests/
|
||||||
|
- name: Upload code coverage stats
|
||||||
|
run: |
|
||||||
|
codecov
|
||||||
Reference in New Issue
Block a user