lorenzwalthert is testing PEP's pre-commit hooks π #57
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 | |
run-name: ${{ github.actor }} is testing PEP's pre-commit hooks π | |
on: | |
push: | |
pull_request: | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ "3.9", "3.10", "3.11" ] | |
env: | |
PYTHON: ${{ matrix.python-version }} | |
steps: | |
- run: echo "π The job was automatically triggered by a ${{ github.event_name }} event." | |
- run: echo "π§ This job is now running on a ${{ runner.os }} server hosted by GitHub!" | |
- run: echo "π The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Set up Poetry | |
run: pipx install poetry | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: poetry | |
- name: Install dependencies | |
run: poetry install | |
- name: Check code formatting | |
run: poetry run black --check . | |
- name: Run linter | |
run: poetry run ruff . | |
- name: Run type checker | |
run: poetry run mypy | |
- name: Run unit tests | |
run: poetry run pytest --cov --cov-report=xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
env_vars: PYTHON | |
files: ./coverage.xml | |
- run: echo "π This job's status is ${{ job.status }}." |