From 9eb6c7f10ed973e356836c7884e3357fef09336e Mon Sep 17 00:00:00 2001 From: Mark Liffiton Date: Wed, 19 Jun 2024 09:39:53 -0500 Subject: [PATCH] Create python-checks.yml Use Github Actions to automatically type check and test new commits and pull requests. --- .github/workflows/python-checks.yml | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/python-checks.yml diff --git a/.github/workflows/python-checks.yml b/.github/workflows/python-checks.yml new file mode 100644 index 0000000..47048e0 --- /dev/null +++ b/.github/workflows/python-checks.yml @@ -0,0 +1,36 @@ +name: Python type checks and tests + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip wheel + pip install -e .[test] + - name: Type check with mypy + run: | + mypy + - name: Test with pytest + run: | + pytest