diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e4ac613 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + test: + strategy: + fail-fast: true + matrix: + python: ["3.8", "3.10", "3.11"] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python }} + - name: Cache + uses: actions/cache@v3.0.11 + with: + path: .venv + key: venv-${{ matrix.python }}-${{ runner.os }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install poetry flake8 pytest + poetry config virtualenvs.in-project true + poetry install + - name: Cache + uses: actions/cache@v3.0.11 + with: + path: .venv + key: venv-${{ runner.os }} + - name: Lint + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test + run: pytest diff --git a/pyproject.toml b/pyproject.toml index 57dd419..d1b69df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ authors = ["Nathan Graule "] readme = "README.md" [tool.poetry.dependencies] -python = "^3.10" +python = "^3.8,^3.10,^3.11" sympy = "^1.11.1" parsec = "^3.15"