Merge pull request #387 from Zsailer/worflows #54
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
name: Tests | |
on: | |
push: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
check_duplicate_runs: | |
name: Check for duplicate runs | |
continue-on-error: true | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@master | |
with: | |
concurrent_skipping: always | |
cancel_others: true | |
skip_after_successful_duplicate: true | |
paths_ignore: '["**/README.md", "**/CHANGELOG.md", "**/LICENSE.md"]' | |
do_not_skip: '["pull_request"]' | |
tests: | |
name: Run tests (Python ${{matrix.python}}) | |
needs: check_duplicate_runs | |
if: ${{ needs.check_duplicate_runs.outputs.should_skip != 'true' }} | |
strategy: | |
matrix: | |
python: | |
- "3.7" | |
- "3.8" | |
- "3.9" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Cache pip | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-python-${{ matrix.python }}-pip-${{ hashFiles('**/requirements*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-python-${{ matrix.python }}-pip-${{ hashFiles('**/requirements*.txt') }} | |
${{ runner.os }}-python-${{ matrix.python }}-pip- | |
${{ runner.os }}-python | |
${{ runner.os }}- | |
- name: Upgrade pip | |
run: python -m pip install --upgrade pip setuptools wheel | |
- name: Install dependencies | |
run: | | |
pip install --upgrade -r requirements.txt -r requirements-test.txt | |
pip install -e . | |
pip freeze | |
- name: Show help | |
run: jupyter kernelgateway --help | |
- name: Run tests | |
run: nosetests --process-restartworker --with-coverage --cover-package=kernel_gateway | |
env: | |
ASYNC_TEST_TIMEOUT: 10 | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
fail_ci_if_error: true |