diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cbb4ff..045057c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Unit Tests, Test Coverage, and Pre-Commit Hooks +name: CI on: pull_request: @@ -10,27 +10,49 @@ on: - closed jobs: - build: + setup: runs-on: ubuntu-latest + outputs: + main-python-version: "3.12" steps: - uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v4 with: - python-version: "3.12" + python-version: ${{ outputs.main-python-version }} + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- - name: Install Dependencies run: | pip install -e . pip install -r requirements.txt - pre-commit install - - name: Run Unit Tests + test-main-python: + needs: setup + runs-on: ubuntu-latest + steps: + - name: Unit Tests run: coverage run -m pytest -s tests - name: Test Coverage run: coverage report --fail-under=96 - - name: Run Pre-Commit Hooks - run: pre-commit run --all-files + - name: Pre-Commit Hooks + run: | + pre-commit install + pre-commit run --all-files + + test-matrix: + needs: setup + runs-on: ubuntu-latest + steps: + - name: Run Test Matrix + run: tox run --skip-env ${{ outputs.main-python-version }} diff --git a/tox.ini b/tox.ini index 6cb06d3..92ec530 100644 --- a/tox.ini +++ b/tox.ini @@ -8,4 +8,6 @@ envlist = [testenv] deps = -r requirements.txt -commands = pytest -s tests +commands = + pytest -s tests + pre-commit run mypy --all-files