From efd67ab2b3fa79b6173f9e383781b26bd99c44a2 Mon Sep 17 00:00:00 2001 From: Thomas Ubensee <34603111+tomuben@users.noreply.github.com> Date: Wed, 2 Oct 2024 14:52:39 +0200 Subject: [PATCH] Use nox sessions in GH workflow for CI --- .github/workflows/check_version.yaml | 2 +- .github/workflows/checks.yaml | 38 +++++++++++++++++++ .../workflows/{run_ci_test.yaml => ci.yaml} | 6 +-- .github/workflows/release.yaml | 2 +- .../lib/config/config_data_model.py | 7 +--- 5 files changed, 45 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/checks.yaml rename .github/workflows/{run_ci_test.yaml => ci.yaml} (83%) diff --git a/.github/workflows/check_version.yaml b/.github/workflows/check_version.yaml index 6405844..cc43839 100644 --- a/.github/workflows/check_version.yaml +++ b/.github/workflows/check_version.yaml @@ -12,7 +12,7 @@ jobs: - name: SCM Checkout uses: actions/checkout@v3 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@0.12.0 + uses: exasol/python-toolbox/.github/actions/python-environment@0.15.0 with: python-version: "3.10" poetry-version: '1.8.2' diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml new file mode 100644 index 0000000..7d6f9eb --- /dev/null +++ b/.github/workflows/checks.yaml @@ -0,0 +1,38 @@ +name: Checks + +on: + pull_request: + +jobs: + + lint-job: + name: Linting and Type checks (Python-${{ matrix.python-version }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.10", "3.11", "3.12"] + + steps: + - name: SCM Checkout + uses: actions/checkout@v4 + + - name: Setup Python & Poetry Environment + uses: exasol/python-toolbox/.github/actions/python-environment@0.15.0 + with: + python-version: ${{ matrix.python-version }} + + - name: Run Unit Tests + run: poetry run nox -s unit-tests + + - name: Run Lint + run: poetry run nox -s lint + + - name: Run type-check + run: poetry run nox -s type-check + + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: ".lint-python-${{ matrix.python-version }}.txt" + path: .lint.txt \ No newline at end of file diff --git a/.github/workflows/run_ci_test.yaml b/.github/workflows/ci.yaml similarity index 83% rename from .github/workflows/run_ci_test.yaml rename to .github/workflows/ci.yaml index b9457cf..f4be40b 100644 --- a/.github/workflows/run_ci_test.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,4 @@ -name: Run Unit Tests +name: Run Integration Tests on: push: @@ -14,9 +14,9 @@ jobs: - name: SCM Checkout uses: actions/checkout@v4 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@0.12.0 + uses: exasol/python-toolbox/.github/actions/python-environment@0.15.0 with: python-version: "3.10" poetry-version: '1.8.2' - name: Run pytest - run: poetry run pytest + run: nox -s integration-tests diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0f1f571..015e2d6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v3 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@0.12.0 + uses: exasol/python-toolbox/.github/actions/python-environment@0.15.0 with: python-version: "3.10" poetry-version: '1.8.2' diff --git a/exasol_script_languages_container_ci/lib/config/config_data_model.py b/exasol_script_languages_container_ci/lib/config/config_data_model.py index 27f33dd..7954696 100644 --- a/exasol_script_languages_container_ci/lib/config/config_data_model.py +++ b/exasol_script_languages_container_ci/lib/config/config_data_model.py @@ -5,17 +5,14 @@ from typing import List -from pydantic import ( - BaseModel, - Extra, -) +from pydantic import BaseModel, Extra class Ignore(BaseModel): class Config: extra = Extra.forbid - paths: list[str] + paths: List[str] class Build(BaseModel):