Skip to content

Commit

Permalink
Combine ci jobs under one workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
culka committed May 29, 2024
1 parent e474d29 commit f7a4789
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 11 deletions.
38 changes: 33 additions & 5 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
name: Push image to Docker hub and run e2e tests

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
check-prettify:
name: Check prettify
uses: ./.github/workflows/check-prettify.yml

check-renovatebot-config:
needs: check-prettify
name: Check renovatebot config
uses: ./.github/workflows/check-renovatebot-config.yml

run-docker-image-tests:
needs:
- check-prettify
- check-renovatebot-config
name: Run docker image tests
uses: ./.github/workflows/ci.yml

push_to_registry:
needs:
- check-prettify
- check-renovatebot-config
- run-docker-image-tests
name: Build & Push docker image to Docker Hub
runs-on: ubuntu-22.04

Expand Down Expand Up @@ -72,6 +89,9 @@ jobs:
run_dump_tests:
needs:
- check-prettify
- check-renovatebot-config
- run-docker-image-tests
- push_to_registry
uses: ./.github/workflows/check-dump.yml

Expand All @@ -90,7 +110,11 @@ jobs:
hasura_version: '${{ env.IMAGE_NAME }}:hsl-${{ env.COMMIT_ID }}'

run_migration_tests:
needs: push_to_registry
needs:
- check-prettify
- check-renovatebot-config
- run-docker-image-tests
- push_to_registry
name: Run migration tests
runs-on: ubuntu-22.04

Expand All @@ -115,7 +139,11 @@ jobs:
run: ./scripts/test-migrations.sh

run_integration_tests:
needs: push_to_registry
needs:
- check-prettify
- check-renovatebot-config
- run-docker-image-tests
- push_to_registry
name: Run hasura integration tests
runs-on: ubuntu-22.04

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/check-prettify.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Check if sources have been prettified

on:
pull_request:
# this workflow is only called by others, won't be executed on itself
workflow_dispatch:

jobs:
check_prettify:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/check-renovatebot-config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Check renovatebot config

on:
pull_request:
# this workflow is only called by others, won't be executed on itself
workflow_dispatch:

jobs:
validate:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Run integration and unit tests

on:
push:
branches:
- main
pull_request:
# this workflow is only called by others, won't be executed on itself
workflow_dispatch:

jobs:
Expand Down

0 comments on commit f7a4789

Please sign in to comment.