Skip to content

Commit

Permalink
Unify CI under one workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
culka committed Jun 3, 2024
1 parent 1ee2d1e commit 28507a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -8,8 +8,13 @@ on:
workflow_dispatch:

jobs:
run_java_tests:
name: Run Java tests
uses: ./.github/workflows/java-tests.yml

push_to_registry:
name: Build & Push docker image to dockerhub
needs: run_java_tests
name: Build & Push Docker image to Docker Hub
runs-on: ubuntu-22.04

steps:
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/java-tests.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 28507a3

Please sign in to comment.