Skip to content

Add common actions and workflows. #1

Add common actions and workflows.

Add common actions and workflows. #1

Workflow file for this run

name: PR Tests
on:
workflow_call:
inputs:
src:
description: 'The path to the source directory.'
required: true
type: string
jobs:
run-tests:
name: Execute unit tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Initialize the environment
uses: ./.github/actions/initialize
- name: Execute unit tests
run: pytest --cov=${{ inputs.src }} --cov-report term-missing:skip-covered --cov-config=tox.ini --no-cov-on-fail --cov-fail-under=100 tests/
run-tests-against-latest:
# These runs are intended to confirm the latest minor version of our dependencies we claim to
# support don't break with our latest changes. Since they're not the versions we directly state
# you should use (i.e. in requirements.txt), they arguably aren't critical, hence not blocking.
name: Non-blocking - Execute unit tests against latest version of dependencies
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Initialize the environment
uses: CitrineInformatics/common-gh-actions/.github/actions/initialize
with:
latest: 'true'
- name: Execute unit tests
run: pytest tests/