build(deps): bump jinja2 from 2.11.3 to 3.1.3 in /requirements #249
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: pytest | |
# Run this workflow every time for pull requests and pushes to master and dev branch | |
on: | |
push: | |
branches: | |
- master | |
- dev | |
pull_request: | |
branches: | |
- master | |
- dev | |
jobs: | |
test-and-coverage: | |
name: Test and Cov py ${{ matrix.python-version }}, ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
max-parallel: 5 | |
matrix: | |
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
python-version: ["3.8"] | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up conda environment | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
mamba-version: "*" | |
activate-environment: minian | |
environment-file: environment.yml | |
- name: Install test dependencies | |
run: | | |
conda install -c conda-forge black==20.8b1 click==8.0.4 pytest==7.0.1 pytest-cov pytest-rerunfailures coverage==6.3.3 | |
- name: Lint with black | |
run: | | |
black --check minian | |
- name: Set up n_workers | |
uses: haya14busa/action-cond@v1 | |
id: n_workers | |
with: | |
cond: ${{ runner.os == 'macOS' }} | |
if_true: 3 | |
if_false: 2 | |
- name: Run doctest | |
run: | | |
pip install -r requirements/requirements-doc.txt | |
sphinx-build -M doctest docs/source docs/build | |
- name: Run tests and collect coverage | |
env: | |
MINIAN_NWORKERS: ${{ steps.n_workers.outputs.value }} | |
run: | | |
pytest -v --color=yes --exitfirst --cov=minian --pyargs minian | |
cp -r img artifact/img | |
- name: Generate xml coverage report | |
if: ${{ runner.os == 'Linux'}} | |
run: | | |
coverage xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
if: ${{ runner.os == 'Linux'}} | |
with: | |
fail_ci_if_error: true | |
- name: Set up conditional SHA value | |
uses: haya14busa/action-cond@v1 | |
id: commit_sha | |
with: | |
cond: ${{ github.event_name == 'pull_request' }} | |
if_true: ${{ github.event.pull_request.head.sha }} | |
if_false: ${{ github.sha }} | |
- name: Upload notebook artifacts | |
uses: actions/upload-artifact@v2 | |
if: ${{ runner.os == 'Linux'}} | |
with: | |
name: notebooks-${{ steps.commit_sha.outputs.value }} | |
path: artifact | |
- name: Trigger RTDs build | |
uses: dfm/rtds-action@v1 | |
if: ${{ runner.os == 'Linux'}} | |
with: | |
webhook_url: ${{ secrets.RTDS_WEBHOOK_URL }} | |
webhook_token: ${{ secrets.RTDS_WEBHOOK_TOKEN }} | |
commit_ref: ${{ github.ref }} |