Skip to content

Tests

Tests #64

Workflow file for this run

# This is a GitHub workflow defining a set of jobs with a set of steps.
# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
#
name: Tests
on:
schedule:
# Weekly, at 03:00 on Monday UTC time
- cron: "0 3 * * 1"
pull_request:
push:
workflow_dispatch:
jobs:
# https://github.com/pre-commit/action
pre-commit:
name: Lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: pre-commit/[email protected]
# Run tests
test:
name: Test
runs-on: ubuntu-22.04
timeout-minutes: 10
strategy:
matrix:
example:
- basic-example
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Get Docker version
run: |
docker --version
docker-compose --version
- name: Install pytest
run: pip install pytest requests
- name: Add a test admin token
run: cat ci/config_token.py >> ${{ matrix.example }}/jupyterhub_config.py
- name: Run JupyterHub
working-directory: ${{ matrix.example }}
run: docker-compose up --detach
- name: Test
working-directory: ${{ matrix.example }}
run: pytest --verbose --capture=no
- name: Print docker-compose logs
if: always()
working-directory: ${{ matrix.example }}
run: docker-compose logs