From 067eaba3e673200771b08894fe0573bb47ad626c Mon Sep 17 00:00:00 2001 From: Kartik Pradeepan Date: Thu, 31 Oct 2024 18:14:22 -0400 Subject: [PATCH] Separate map_new_plugins into two jobs and allow re-run --- .github/workflows/map_new_plugins.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/map_new_plugins.yml b/.github/workflows/map_new_plugins.yml index b38a39e75..bf4dd4cab 100644 --- a/.github/workflows/map_new_plugins.yml +++ b/.github/workflows/map_new_plugins.yml @@ -10,9 +10,11 @@ on: jobs: # Trigger Layer Mapping only on web_submissions OR if trigger-mapping label is added to PR - trigger_layer_mapping: - name: Trigger Layer Mapping + check_jenkins_jobs: + name: Check Triggers runs-on: ubuntu-latest + outputs: + all_checks_passed: ${{ steps.set_output.outputs.all_checks_passed }} if: | ( ( @@ -28,6 +30,7 @@ jobs: run: | required_checks=("Brain-Score Plugins Unit tests (AWS Jenkins, AWS Execution)" "Brain-Score Non-Plugin Unit tests (AWS Jenkins, AWS Execution)") completed_checks=0 + all_checks_passed=true echo "Using github PR head sha: ${{ github.event.pull_request.head.sha }}" @@ -45,17 +48,19 @@ jobs: ((completed_checks+=1)) else echo "Job '$check' is NOT successful." + all_checks_passed=false fi done echo "Completed checks: $completed_checks / ${#required_checks[@]}" + echo "::set-output name=all_checks_passed::$all_checks_passed" - # Fail this step if not all required jobs are completed - if [ "$completed_checks" -ne "${#required_checks[@]}" ]; then - echo "Not all required Jenkins jobs are complete. Exiting." - exit 1 - fi - + trigger_layer_mapping: + name: Trigger Layer Mapping + runs-on: ubuntu-latest + needs: check_jenkins_jobs + if: ${{ needs.check_jenkins_jobs.outputs.all_checks_passed == 'true' }} + steps: # Check out PR head - name: Check out repository code uses: actions/checkout@v4