Add CI and pre-commit config #1
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: tests | |
on: | |
push: | |
branches: [ main, ci ] | |
paths: | |
- '**.py' | |
- '.github/workflows/tests.yml' | |
pull_request: | |
branches: [ main ] | |
paths: | |
- '**.py' | |
- '.github/workflows/tests.yml' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: python3 -m pip install '.[test]' | |
- name: Lint with flake8 | |
run: | | |
python -m pip install ruff | |
python -m ruff check . | |
- name: Test with unittest | |
run: | | |
python -m unittest |