kopia lustrzana https://github.com/jupyterhub/repo2docker
134 wiersze
3.5 KiB
YAML
134 wiersze
3.5 KiB
YAML
# 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: Test
|
|
|
|
on:
|
|
pull_request:
|
|
paths-ignore:
|
|
- "docs/**"
|
|
- "**.md"
|
|
- "**.rst"
|
|
- ".github/workflows/*"
|
|
- "!.github/workflows/test.yml"
|
|
push:
|
|
paths-ignore:
|
|
- "docs/**"
|
|
- "**.md"
|
|
- "**.rst"
|
|
- ".github/workflows/*"
|
|
- "!.github/workflows/test.yml"
|
|
branches-ignore:
|
|
- "dependabot/**"
|
|
- "pre-commit-ci-update-config"
|
|
tags:
|
|
- "**"
|
|
schedule:
|
|
# Run weekly test so we know if tests break for external reasons
|
|
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events
|
|
#
|
|
# At 10:36 on Sunday (https://crontab.guru)
|
|
- cron: '36 10 * * 0'
|
|
workflow_dispatch:
|
|
|
|
# Global environment variables
|
|
env:
|
|
GIT_COMMITTER_EMAIL: ci-user@github.local
|
|
GIT_COMMITTER_NAME: CI User
|
|
GIT_AUTHOR_EMAIL: ci-user@github.local
|
|
GIT_AUTHOR_NAME: CI User
|
|
|
|
jobs:
|
|
pre-commit:
|
|
runs-on: ubuntu-22.04
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python_version: ["3.9"]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "${{ matrix.python_version }}"
|
|
|
|
# There will almost never be a cache hit on the cache key when this job is
|
|
# run, as it is the first of all jobs in this workflow. The subsequent
|
|
# jobs in this workflow can rely on this cache though.
|
|
- name: Save pip's install cache on job completion
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: "${{ github.run_id }}-${{ matrix.python_version }}"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install -r dev-requirements.txt
|
|
pip freeze
|
|
|
|
- run: pre-commit run --all-files
|
|
|
|
test:
|
|
needs: pre-commit
|
|
runs-on: ubuntu-${{ matrix.ubuntu_version }}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
ubuntu_version: ["22.04"]
|
|
python_version: ["3.9"]
|
|
repo_type:
|
|
- base
|
|
- conda
|
|
- dockerfile
|
|
- external
|
|
- julia
|
|
- nix
|
|
- pipfile
|
|
- r
|
|
- unit
|
|
- venv
|
|
include:
|
|
# The actions/setup-python action with Python version 3.6 isn't
|
|
# possible to use with the ubuntu-22.04 runner, so we use ubuntu-20.04
|
|
# for this test where Python 3.6 remain available.
|
|
- ubuntu_version: "20.04"
|
|
python_version: "3.6"
|
|
repo_type: venv
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "${{ matrix.python_version }}"
|
|
|
|
- name: Restore pip's install cache from previous job
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: "${{ github.run_id }}-${{ matrix.python_version }}"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install -r dev-requirements.txt
|
|
pip freeze
|
|
|
|
- name: Install repo2docker
|
|
run: |
|
|
python setup.py bdist_wheel
|
|
pip install dist/*.whl
|
|
|
|
# add for mercurial tests
|
|
pip install mercurial hg-evolve
|
|
|
|
pip freeze
|
|
|
|
- name: Run pytest
|
|
run: |
|
|
pytest --verbose --color=yes --durations=10 --cov=repo2docker tests/${{ matrix.repo_type }}
|
|
|
|
- name: Submit codecov report
|
|
run: |
|
|
codecov
|