diff --git a/.github/workflows/check_ci.yaml b/.github/workflows/check_ci.yaml index b81d34cc..dd0e5dbd 100644 --- a/.github/workflows/check_ci.yaml +++ b/.github/workflows/check_ci.yaml @@ -1,12 +1,10 @@ name: CI Build on: - push: - branches-ignore: - - "main" + pull_request: jobs: - run_unit_tests: + run-unit-tests: runs-on: ubuntu-latest steps: @@ -18,7 +16,7 @@ jobs: uses: exasol/python-toolbox/.github/actions/python-environment@0.13.0 with: python-version: "3.10" - poetry-version: '1.8.2' + poetry-version: "1.8.2" - name: Run Unit Tests run: > @@ -28,14 +26,14 @@ jobs: --override-ini=log_cli_level=INFO test/unit - run_integration_tests: + run-integration-tests: name: Integration Tests environment: AWS_CI_TESTS runs-on: ubuntu-latest - needs: run_unit_tests + needs: run-unit-tests steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -61,8 +59,7 @@ jobs: uses: exasol/python-toolbox/.github/actions/python-environment@0.13.0 with: python-version: "3.10" - poetry-version: '1.8.2' - + poetry-version: "1.8.2" - name: Run Integration Tests run: > @@ -76,15 +73,23 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY_SECRET }} AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }} - run_notebook_tests: + approval-for-notebook-tests: + name: Run Jupyter Notebook Tests? + runs-on: ubuntu-latest + steps: + - name: Detect Running Notebook Tests + run: true + environment: + approve-test-execution + + run-notebook-tests: name: Jupyter Notebook Tests - if: "contains(github.event.head_commit.message, '[run-notebook-tests]')" environment: AWS_SAGEMAKER runs-on: ubuntu-latest - needs: run_unit_tests + needs: approval-for-notebook-tests steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -110,8 +115,7 @@ jobs: uses: exasol/python-toolbox/.github/actions/python-environment@0.13.0 with: python-version: "3.10" - poetry-version: '1.8.2' - + poetry-version: "1.8.2" - name: Run notebook tests run: > @@ -127,3 +131,11 @@ jobs: SAAS_HOST: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_HOST }} SAAS_ACCOUNT_ID: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_ACCOUNT_ID }} SAAS_PAT: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_PAT }} + + gate-2: + name: Gate 2 - Allow Merge + runs-on: ubuntu-latest + needs: [ run-unit-tests, run-integration-tests, run-notebook-tests ] + steps: + - name: Branch Protection + run: true diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 783b43d2..8b3b0ca0 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,6 +1,6 @@ # Changes -* [2.1.0](changes_2.1.0.md) +* [unreleased](unreleased.md) * [2.0.0](changes_2.0.0.md) * [1.0.0](changes_1.0.0.md) * [0.2.0](changes_0.2.0.md) diff --git a/doc/changes/changes_2.1.0.md b/doc/changes/unreleased.md similarity index 95% rename from doc/changes/changes_2.1.0.md rename to doc/changes/unreleased.md index 1bf4ea0a..4b63b64d 100644 --- a/doc/changes/changes_2.1.0.md +++ b/doc/changes/unreleased.md @@ -35,3 +35,4 @@ n/a * #267: Switched CodeBuildWaiter to use tenacity * #276: Started using the new ITDE Manager interface in the notebook-connector 0.2.9 * #282: Updated python version to Python 3.10 +* #295: Made notebook-tests mandatory for merge diff --git a/doc/developer_guide/ci.md b/doc/developer_guide/ci.md index 4c753814..948dc3fd 100644 --- a/doc/developer_guide/ci.md +++ b/doc/developer_guide/ci.md @@ -3,20 +3,16 @@ The project has two types of CI tests: * Unit tests and integration tests which run in a Github workflow * Special integration tests verifying the content of the Jupyter notebook files -* A system test which runs on a AWS Codebuild +* A system test which runs in a AWS Codebuild All these tests need to pass before the approval of a Github PR. The Github workflow will run on each push to a branch in the Github repository. -However, the notebook tests and the AWS Codebuild will only run after you push a commit containing a special string in the commit message, see the following sections. +However, the notebook tests and the AWS Codebuild will only run under specific conditions, e.g. manual approval or push a commit containing a special string in the commit message, see the following sections. -### Executing Notebook Tests +### Executing Jupyter Notebook Tests -Use the following git commands to execute the notebook tests: - -```shell -git commit -m "[run-notebook-tests]" --allow-empty && git push -``` +The regular CI build will ask for confirmation (aka. "review") before executing these tests, see [ETAJ developer guide](https://github.com/exasol/exasol-test-setup-abstraction-java/blob/main/doc/developer_guide/developer_guide.md#ci-build) for details. ### Executing AWS CodeBuild