Tests #137
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 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: | |
# Run tests | |
test: | |
name: Test | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
example: | |
- basic-example | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- name: Get Docker version | |
run: | | |
docker --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 |