From 8c7bd86748faa990527494b43c459309996e90aa Mon Sep 17 00:00:00 2001 From: Alessio Vertemati Date: Tue, 17 Sep 2024 14:22:30 +0200 Subject: [PATCH 1/3] wip: CI workflow --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..232d5a8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: CI + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + test: + name: Tests Python ${{ matrix.python-version }} + runs-on: ubuntu-latest + + strategy: + fail-fast: true + matrix: + python-version: ["3.11", "3.12", "3.13-dev"] + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + allow-prereleases: true + cache: pip + cache-dependency-path: | + **/setup.py + **/requirements*.txt + + - name: Install dependencies + run: | + pip install -r requirements.txt -r requirements-dev.txt + + - name: Run Testsuite + run: | + pytest diff --git a/setup.py b/setup.py index 9d0edb0..c137cd4 100644 --- a/setup.py +++ b/setup.py @@ -29,5 +29,6 @@ ], packages=['parse_document_model'], include_package_data=True, + python_requires=">=3.9", install_requires=['pydantic>=2.9.0'] ) From de4e84bf084c7ffe49adc55ffa4049f5245f5f6b Mon Sep 17 00:00:00 2001 From: Alessio Vertemati Date: Tue, 17 Sep 2024 14:24:25 +0200 Subject: [PATCH 2/3] Limit to only run push on main and when a pull request is opened to prevent duplicate jobs --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 232d5a8..8451eed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,11 @@ name: CI -on: [push, pull_request] +on: + push: + branches: + - "main" + pull_request: + types: [opened, synchronize, reopened] permissions: contents: read From 141bc172f609d341dbb554a80cbd6a7a74cb97dd Mon Sep 17 00:00:00 2001 From: Alessio Vertemati Date: Tue, 17 Sep 2024 14:27:08 +0200 Subject: [PATCH 3/3] Add 3.9 and 3.10 to the test matrix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8451eed..57ecf70 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: true matrix: - python-version: ["3.11", "3.12", "3.13-dev"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13-dev"] steps: - uses: actions/checkout@v4