From ed16340994231437b76742685402602bf12437ff Mon Sep 17 00:00:00 2001 From: Jens Peder Meldgaard Date: Sat, 28 Dec 2024 17:28:35 +0100 Subject: [PATCH] test: separate integration tests Signed-off-by: Jens Peder Meldgaard --- .github/workflows/integration_tests.yml | 40 +++++++++++++++++++++++++ .github/workflows/publish.yml | 10 ++++++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/integration_tests.yml diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml new file mode 100644 index 0000000..69ef8b5 --- /dev/null +++ b/.github/workflows/integration_tests.yml @@ -0,0 +1,40 @@ +name: Integration Tests + +on: + workflow_call: {} + +jobs: + test: + name: Run tests + if: ${{ !startsWith(github.event.head_commit.message, 'bump:') && github.repository_owner_id == github.actor_id }} + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12"] + steps: + - uses: actions/checkout@v4 + # Download the Databricks CLI. + # See https://github.com/databricks/setup-cli + - uses: databricks/setup-cli@main + - uses: eifinger/setup-rye@v3 + id: setup-rye + with: + version: "0.42.0" + - name: Pin python-version ${{ matrix.python-version }} + run: rye pin ${{ matrix.python-version }} + - name: Install dependencies + run: rye sync --no-lock + - name: Lint code + run: rye lint + - name: Run tests + run: | + source .venv/bin/activate + rye test -- -x + env: + DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }} + DATABRICKS_CLIENT_ID: ${{ secrets.DATABRICKS_CLIENT_ID }} + DATABRICKS_CLIENT_SECRET: ${{ secrets.DATABRICKS_CLIENT_SECRET }} + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 239e666..fa5ad1f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,6 +6,14 @@ on: - master jobs: + integration_tests: + name: Integration Tests + if: ${{ !startsWith(github.event.head_commit.message, 'bump:') && github.repository_owner_id == github.actor_id }} + uses: + .github/workflows/integration_tests.yml + + # Download the Databricks CLI. + # See test: name: Run tests if: ${{ !startsWith(github.event.head_commit.message, 'bump:') }} @@ -31,7 +39,7 @@ jobs: - name: Run tests run: | source .venv/bin/activate - rye test + rye test -- -x env: DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }} DATABRICKS_CLIENT_ID: ${{ secrets.DATABRICKS_CLIENT_ID }}