Skip to content

Commit

Permalink
fix trigger condition for build jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
geekflyer authored and sionescu committed Jun 5, 2023
1 parent 0223218 commit 77632dd
Showing 1 changed file with 43 additions and 50 deletions.
93 changes: 43 additions & 50 deletions .github/workflows/docker-build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,43 +171,8 @@ jobs:
FEATURES: consensus-only-perf-test
BUILD_ADDL_TESTING_IMAGES: true

rust-images-all:
needs:
[
determine-docker-build-metadata,
rust-images,
rust-images-indexer,
rust-images-failpoints,
rust-images-performance,
rust-images-consensus-only-perf-test,
]
if: always() # this ensures that the job will run even if the previous jobs were skipped
runs-on: ubuntu-latest
steps:
- name: fail if rust-images job failed
if: ${{ needs.rust-images.result == 'failure' }}
run: exit 1
- name: fail if rust-images-indexer job failed
if: ${{ needs.rust-images-indexer.result == 'failure' }}
run: exit 1
- name: fail if rust-images-failpoints job failed
if: ${{ needs.rust-images-failpoints.result == 'failure' }}
run: exit 1
- name: fail if rust-images-performance job failed
if: ${{ needs.rust-images-performance.result == 'failure' }}
run: exit 1
- name: fail if rust-images-consensus-only-perf-test job failed
if: ${{ needs.rust-images-consensus-only-perf-test.result == 'failure' }}
run: exit 1
outputs:
rustImagesResult: ${{ needs.rust-images.result }}
rustImagesIndexerResult: ${{ needs.rust-images-indexer.result }}
rustImagesFailpointsResult: ${{ needs.rust-images-failpoints.result }}
rustImagesPerformanceResult: ${{ needs.rust-images-performance.result }}
rustImagesConsensusOnlyPerfTestResult: ${{ needs.rust-images-consensus-only-perf-test.result }}

sdk-release:
needs: [rust-images, determine-docker-build-metadata] # runs with the default release docker build variant "rust-images"
needs: [permission-check, rust-images, determine-docker-build-metadata] # runs with the default release docker build variant "rust-images"
if: |
(github.event_name == 'push' && github.ref_name != 'main') ||
github.event_name == 'workflow_dispatch' ||
Expand All @@ -220,7 +185,7 @@ jobs:
GIT_SHA: ${{ needs.determine-docker-build-metadata.outputs.gitSha }}

cli-e2e-tests:
needs: [rust-images, determine-docker-build-metadata] # runs with the default release docker build variant "rust-images"
needs: [permission-check, rust-images, determine-docker-build-metadata] # runs with the default release docker build variant "rust-images"
if: |
!contains(github.event.pull_request.labels.*.name, 'CICD:skip-sdk-integration-test') && (
github.event_name == 'push' ||
Expand All @@ -235,7 +200,7 @@ jobs:
GIT_SHA: ${{ needs.determine-docker-build-metadata.outputs.gitSha }}

indexer-grpc-e2e-tests:
needs: [rust-images, determine-docker-build-metadata] # runs with the default release docker build variant "rust-images"
needs: [permission-check, rust-images, determine-docker-build-metadata] # runs with the default release docker build variant "rust-images"
if: |
(github.event_name == 'push' && github.ref_name != 'main') ||
github.event_name == 'workflow_dispatch' ||
Expand All @@ -248,9 +213,16 @@ jobs:
GIT_SHA: ${{ needs.determine-docker-build-metadata.outputs.gitSha }}

forge-e2e-test:
needs: [rust-images-all, determine-docker-build-metadata]
if: | # always() ensures that the job will run even if some of the previous docker variant build jobs were skipped https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions
always() && needs.rust-images-all.result == 'success' && (
needs:
- permission-check
- determine-docker-build-metadata
- rust-images
- rust-images-indexer
- rust-images-failpoints
- rust-images-performance
- rust-images-consensus-only-perf-test
if: |
!failure() && !cancelled() && needs.permission-check.result == 'success' && (
(github.event_name == 'push' && github.ref_name != 'main') ||
github.event_name == 'workflow_dispatch' ||
contains(github.event.pull_request.labels.*.name, 'CICD:run-e2e-tests') ||
Expand All @@ -272,9 +244,16 @@ jobs:

# Run e2e compat test against testnet branch
forge-compat-test:
needs: [rust-images-all, determine-docker-build-metadata]
if: | # always() ensures that the job will run even if some of the previous docker variant build jobs were skipped https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions
always() && needs.rust-images-all.result == 'success' && (
needs:
- permission-check
- determine-docker-build-metadata
- rust-images
- rust-images-indexer
- rust-images-failpoints
- rust-images-performance
- rust-images-consensus-only-perf-test
if: |
!failure() && !cancelled() && needs.permission-check.result == 'success' && (
(github.event_name == 'push' && github.ref_name != 'main') ||
github.event_name == 'workflow_dispatch' ||
contains(github.event.pull_request.labels.*.name, 'CICD:run-e2e-tests') ||
Expand All @@ -293,9 +272,16 @@ jobs:

# Run forge framework upgradability test
forge-framework-upgrade-test:
needs: [rust-images-all, determine-docker-build-metadata]
if: | # always() ensures that the job will run even if some of the previous docker variant build jobs were skipped https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions
always() && needs.rust-images-all.result == 'success' && (
needs:
- permission-check
- determine-docker-build-metadata
- rust-images
- rust-images-indexer
- rust-images-failpoints
- rust-images-performance
- rust-images-consensus-only-perf-test
if: |
!failure() && !cancelled() && needs.permission-check.result == 'success' && (
(github.event_name == 'push' && github.ref_name != 'main') ||
github.event_name == 'workflow_dispatch' ||
contains(github.event.pull_request.labels.*.name, 'CICD:run-e2e-tests') ||
Expand All @@ -313,9 +299,16 @@ jobs:
FORGE_NAMESPACE: forge-framework-upgrade-${{ needs.determine-docker-build-metadata.outputs.targetCacheId }}

forge-consensus-only-perf-test:
needs: [rust-images-all, determine-docker-build-metadata]
if: | # always() ensures that the job will run even if some of the previous docker variant build jobs were skipped https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions
always() && needs.rust-images-all.result == 'success' &&
needs:
- permission-check
- determine-docker-build-metadata
- rust-images
- rust-images-indexer
- rust-images-failpoints
- rust-images-performance
- rust-images-consensus-only-perf-test
if: |
!failure() && !cancelled() && needs.permission-check.result == 'success' &&
contains(github.event.pull_request.labels.*.name, 'CICD:run-consensus-only-perf-test')
uses: aptos-labs/aptos-core/.github/workflows/workflow-run-forge.yaml@main
secrets: inherit
Expand Down

0 comments on commit 77632dd

Please sign in to comment.