Update workflows #30
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: Run Tests | |
on: | |
# Trigger on push to default branch | |
push: | |
branches: | |
- main | |
# Trigger the workflow on pull request events | |
# but only for the master branch | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
linter: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install packages | |
run: | | |
pip install flake8 black | |
- name: Linter (flake8) | |
run: flake8 . | |
- name: Linter (black) | |
run: black --check . | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-versions: | |
- '3.9' | |
- '3.10' | |
- '3.11' | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-versions }} | |
- name: Install packages | |
run: | | |
pip install -r requirements.txt | |
- name: Run tests | |
run: python -m unittest discover |