From 7400ccb00ab9b9800dd64acd6bb666a58897a7ef Mon Sep 17 00:00:00 2001 From: Thomas Ubensee <34603111+tomuben@users.noreply.github.com> Date: Fri, 22 Nov 2024 11:17:01 -0300 Subject: [PATCH] #427: Use GH merge-gate from TBX for slow tests --- .github/workflows/pr-merge.yml | 3 +++ .github/workflows/publish_docker_runner.yml | 5 +--- .github/workflows/shellcheck.yaml | 11 --------- .../workflows/test_db_versions_all_tests.yml | 23 ++----------------- .../workflows/test_db_versions_minimal.yml | 5 +--- .github/workflows/test_docker_starter.yml | 5 +--- .github/workflows/test_python_version.yml | 7 +++--- .github/workflows/test_shell_scripts.yml | 8 ++++++- .github/workflows/tests_with_coverage.yml | 14 +++++++++-- 9 files changed, 30 insertions(+), 51 deletions(-) delete mode 100644 .github/workflows/shellcheck.yaml diff --git a/.github/workflows/pr-merge.yml b/.github/workflows/pr-merge.yml index e4be0103a..c2d097eb1 100644 --- a/.github/workflows/pr-merge.yml +++ b/.github/workflows/pr-merge.yml @@ -23,3 +23,6 @@ jobs: metrics: needs: [ ci-job ] uses: ./.github/workflows/report.yml + + publish-docker-runnmer: + uses: ./.github/workflows/publish_docker_runner.yml \ No newline at end of file diff --git a/.github/workflows/publish_docker_runner.yml b/.github/workflows/publish_docker_runner.yml index a982d9159..3878abdf5 100644 --- a/.github/workflows/publish_docker_runner.yml +++ b/.github/workflows/publish_docker_runner.yml @@ -1,10 +1,7 @@ name: Publish Docker Runner on: - push: - branches: - - main - - 'ci-release-test/**' + workflow_call: jobs: publish: diff --git a/.github/workflows/shellcheck.yaml b/.github/workflows/shellcheck.yaml deleted file mode 100644 index 5603d1858..000000000 --- a/.github/workflows/shellcheck.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: Check bash scripts - -on: [push] - -jobs: - shellcheck: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Run shellcheck - run: ./scripts/build/shellcheck.sh diff --git a/.github/workflows/test_db_versions_all_tests.yml b/.github/workflows/test_db_versions_all_tests.yml index 743bcf47a..995c9f713 100644 --- a/.github/workflows/test_db_versions_all_tests.yml +++ b/.github/workflows/test_db_versions_all_tests.yml @@ -1,13 +1,11 @@ name: Test DB Versions with all tests on: - push: - branches: - - main - pull_request: + workflow_call: jobs: get_exasol_versions: + uses: ./.github/workflows/get_exasol_versions.yml test-db-versions-all-tests: @@ -27,22 +25,5 @@ jobs: python-version: "3.10" poetry-version: '1.8.2' - - name: Fail, because not all tests are activated - run: | - git fetch - GIT_LOG="$(git log --pretty=oneline --abbrev-commit ${{ github.event.after }} | head -n 1)" - echo "$GIT_LOG" - if [[ "$GIT_LOG" == *"[run all tests]"* ]]; then - echo "All tests activated" - exit 0 - else - echo "Fail, because not all tests are activated" - exit 1 - fi - env: - EXASOL_VERSION: "${{ matrix.exasol_version }}" - # We want to deactivate running all tests only for pull_requests - if: ${{ github.event_name == 'pull_request' }} - - name: Run all tests run: poetry run nox -s "run-tests(db_version='${{ matrix.exasol_version }}')" diff --git a/.github/workflows/test_db_versions_minimal.yml b/.github/workflows/test_db_versions_minimal.yml index 777d49cb5..a957b769f 100644 --- a/.github/workflows/test_db_versions_minimal.yml +++ b/.github/workflows/test_db_versions_minimal.yml @@ -1,10 +1,7 @@ name: Test DB Versions with minimal tests on: - push: - branches: - - main - pull_request: + workflow_call: jobs: diff --git a/.github/workflows/test_docker_starter.yml b/.github/workflows/test_docker_starter.yml index d6e00868b..0973e6bd6 100644 --- a/.github/workflows/test_docker_starter.yml +++ b/.github/workflows/test_docker_starter.yml @@ -1,10 +1,7 @@ name: Test Docker Starter on: - push: - branches: - - main - pull_request: + workflow_call: jobs: test-docker-starter: diff --git a/.github/workflows/test_python_version.yml b/.github/workflows/test_python_version.yml index 4eb5e4414..e0efaeaf1 100644 --- a/.github/workflows/test_python_version.yml +++ b/.github/workflows/test_python_version.yml @@ -1,10 +1,7 @@ name: Test Python Versions with all tests on: - push: - branches: - - main - pull_request: + workflow_call: jobs: test-python-version-all-tests: @@ -16,6 +13,8 @@ jobs: python_version: - "3.9" - "3.10" + - "3.11" + - "3.12" name: Run tests with Python ${{ matrix.python_version }} and Exasol ${{ matrix.exasol_version }} runs-on: ubuntu-latest steps: diff --git a/.github/workflows/test_shell_scripts.yml b/.github/workflows/test_shell_scripts.yml index 1ca1eab27..754cfc7df 100644 --- a/.github/workflows/test_shell_scripts.yml +++ b/.github/workflows/test_shell_scripts.yml @@ -1,6 +1,7 @@ name: Test Shell Scripts -on: [push] +on: + workflow_call: jobs: build: @@ -9,6 +10,9 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Run shellcheck + run: ./scripts/build/shellcheck.sh + - name: Install Test Dependencies run: | sudo apt-get install -y shunit2 @@ -19,3 +23,5 @@ jobs: - name: Run Starter Script Tests run: starter_scripts/test/test_scripts.sh + + diff --git a/.github/workflows/tests_with_coverage.yml b/.github/workflows/tests_with_coverage.yml index cce50bf00..82a1776e4 100644 --- a/.github/workflows/tests_with_coverage.yml +++ b/.github/workflows/tests_with_coverage.yml @@ -37,7 +37,14 @@ jobs: name: coverage-python${{ matrix.python-version }} path: .coverage include-hidden-files: true - + Db-Version-Minimal-Tests: + uses: ./.github/workflows/test_db_versions_minimal.yml + Test-Docker-Starter: + uses: ./.github/workflows/test_docker_starter.yml + Test-Python-Version: + uses: ./.github/workflows/test_python_version.yml + Test-Shell-Scripts: + uses: ./.github/workflows/test_shell_scripts.yml Slow-Tests: name: Slow runs-on: ubuntu-latest @@ -55,4 +62,7 @@ jobs: steps: - name: Tests run: | - echo "Slow tests ran successfully" + echo "Slow tests approved" + Test-Db-Versions-All-Tests: + needs: Slow-Tests + uses: ./.github/workflows/test_db_versions_all_tests.yml