use png in social card #19
This file contains hidden or 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: Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
defaults: | |
run: | |
shell: bash -e {0} # -e to fail on error | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ["3.10", "3.12"] | |
os: [ubuntu-latest] | |
# one that matches "project-name".lower().replace('-', '_'), one that doesn’t: | |
package-name: [scmorph] | |
env: | |
PROJECT_ROOT: . | |
steps: | |
# Setup | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: "pip" | |
cache-dependency-path: "**/pyproject.toml" | |
- name: Install Ubuntu system dependencies | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get install pandoc | |
- name: Install build & check dependencies | |
run: python -m pip install --upgrade pip wheel cookiecutter pre-commit | |
# Check | |
- name: Set up pre-commit cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit-3|${{ matrix.python }}|${{ hashFiles(format('{0}/.pre-commit-config.yaml', env.PROJECT_ROOT)) }} | |
- name: Run pre-commit | |
run: | | |
cd "$PROJECT_ROOT" | |
git add . | |
pre-commit run --verbose --color=always --show-diff-on-failure --all-files | |
- name: Install the package | |
run: | | |
cd $PROJECT_ROOT | |
pip install ".[doc,test]" | |
python -c "import ${{ matrix.package-name }}" | |
# Docs | |
- name: Build the documentation | |
env: | |
SPHINXOPTS: --keep-going | |
run: | | |
cd "$PROJECT_ROOT/docs" | |
make html | |
- name: Test | |
env: | |
MPLBACKEND: agg | |
PLATFORM: ${{ matrix.os }} | |
DISPLAY: :42 | |
run: | | |
pytest --cov --cov-report=xml | |
- name: Report coverage | |
run: | | |
coverage report | |
- name: Upload coverage | |
uses: codecov/codecov-action@v5 | |
with: | |
name: codecov-umbrella # optional | |
verbose: true # optional (default = false) | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |