From b4a06ae1012974263af72a152859c9d4e81a7d77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Teemu=20M=C3=A4kinen?= Date: Wed, 29 May 2024 10:42:39 +0300 Subject: [PATCH] Unify CI under one workflow --- .github/workflows/cd.yml | 11 +++++++++-- .github/workflows/java-tests.yml | 5 ++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d8b2da80..7c155785 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,4 +1,4 @@ -name: Push image to docker hub and run e2e tests +name: Run Java tests, push image to docker hub and run e2e tests on: push: @@ -8,7 +8,12 @@ on: workflow_dispatch: jobs: + run_java_tests: + name: Run Java tests + uses: ./.github/workflows/java-tests.yml + push_to_registry: + needs: run_java_tests name: Build & Push docker image to dockerhub runs-on: ubuntu-22.04 @@ -58,7 +63,9 @@ jobs: docker push $IMAGE_NAME:latest run_e2e_tests: - needs: push_to_registry + needs: + - run_java_tests + - push_to_registry name: Run E2E tests runs-on: ubuntu-22.04 steps: diff --git a/.github/workflows/java-tests.yml b/.github/workflows/java-tests.yml index be3e56c4..03a8fa4c 100644 --- a/.github/workflows/java-tests.yml +++ b/.github/workflows/java-tests.yml @@ -1,9 +1,8 @@ name: Run java tests on: - push: - pull_request: - branches: [main] + # this workflow is only called by others, won't be executed on itself + workflow_call: jobs: run-tests: