Redesign of the docs #553
Workflow file for this run
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 workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: CI | |
on: | |
push: | |
branches: | |
- "main" | |
- "release*" | |
- "*-devel" | |
- "*_devel" | |
- "*-ci" | |
- "*_ci" | |
pull_request: # Run on all pull requests | |
workflow_dispatch: # needed for "Run" button to show up in action | |
env: | |
FORCE_COLOR: "1" # Make tools pretty. | |
PIP_DISABLE_PIP_VERSION_CHECK: "1" | |
PIP_NO_PYTHON_VERSION_WARNING: "1" | |
jobs: | |
tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
# Ensure that if even if a build in the matrix fails, the others continue | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# Enable caching of pip packages between workflow jobs. This can speed things up dramatically, _if_ | |
# jobs are executed fairly close together in time | |
# See: https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#caching-packages | |
cache: 'pip' | |
cache-dependency-path: 'requirements.txt' | |
- name: Install dependencies | |
run: | | |
# Install requirements, as compiled by pip-compile | |
pip install -r requirements.txt | |
# Install dysh itself, in editable mode (which is required to avoid breaking the caching mechanism above) | |
pip install -e . | |
- name: Test with pytest | |
run: | | |
# Write coverage data files, namespaced using matrix info | |
coverage run --data-file="coverage.${{ matrix.os }}.${{ matrix.python-version }}" -m pytest | |
- name: Upload coverage data | |
# Upload only ubuntu results, since we are only running the coverage step on ubuntu | |
if: matrix.os == 'ubuntu-latest' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage.${{ matrix.os }}.${{ matrix.python-version }} | |
path: "coverage.ubuntu-latest*" | |
coverage: | |
needs: tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
cache: pip | |
- run: pip install --upgrade coverage[toml] | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: coverage.* | |
path: coverage-data | |
merge-multiple: true | |
- name: Combine coverage | |
run: | | |
coverage combine coverage-data/coverage.* | |
coverage html --skip-covered --skip-empty | |
# Report and write to summary. | |
coverage report | sed 's/^/ /' >> $GITHUB_STEP_SUMMARY | |
# Report again and fail if under 100%. | |
# coverage report --fail-under=100 | |
- name: Upload HTML report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: html-report | |
path: htmlcov |