Test #623
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: Test | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
schedule: | |
- cron: "0 5 * * *" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
pint-version: | |
# Force specific version of pint | |
- "==0.17" | |
- "==0.18" | |
- "==0.19.1" | |
# No change, i.e. latest | |
- "" | |
name: pint${{ matrix.pint-version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
cache: pip | |
cache-dependency-path: "**/pyproject.toml" | |
- name: Install | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[tests] | |
# Force a specific version of pint | |
pip install pint${{ matrix.pint-version }} | |
- name: Test | |
run: | | |
pytest iam_units \ | |
-rA -vv --color=yes \ | |
--cov=iam_units --cov-report=xml | |
- name: Upload test coverage to Codecov.io | |
uses: codecov/codecov-action@v3 | |
pre-commit: | |
name: Code quality | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
- name: Force recreation of pre-commit virtual environment for mypy | |
if: github.event_name == 'schedule' # Comment this line to run on a PR | |
run: gh cache delete $(gh cache list -L 999 | cut -f2 | grep pre-commit) | |
env: { GH_TOKEN: "${{ github.token }}" } | |
- uses: pre-commit/[email protected] |