From 35ab0fd223c52e9a5acb9b7de6c11af671064e2d Mon Sep 17 00:00:00 2001 From: Oliver Koenig Date: Wed, 18 Dec 2024 01:16:24 +0100 Subject: [PATCH] final Signed-off-by: Oliver Koenig --- .github/workflows/cicd-main.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cicd-main.yml b/.github/workflows/cicd-main.yml index fe5976bc0..58ba702ae 100644 --- a/.github/workflows/cicd-main.yml +++ b/.github/workflows/cicd-main.yml @@ -41,7 +41,7 @@ jobs: outputs: test_to_run: ${{ steps.test_to_run.outputs.main }} all: ${{ steps.all.outputs.main }} - docs_only: ${{ steps.changed-files.outputs.doc_any_changed == 'true' && steps.changed-files.outputs.src_any_changed == 'false' }} + run_ci: ${{ steps.evaluate.outputs.run_ci }} steps: - name: Parse test_to_run id: test_to_run @@ -68,6 +68,7 @@ jobs: - '!.github/**' - name: Evaluate conditions + id: evaluate env: DOCS_ONLY: ${{ steps.changed-files.outputs.doc_any_changed == 'true' && steps.changed-files.outputs.src_any_changed == 'false' }} LABEL: ${{ github.event.label.name == 'Run CICD' }} @@ -79,8 +80,10 @@ jobs: echo "label: $LABEL" echo "main_branch: $MAIN_BRANCH" + echo run_ci=$([[ ("$LABEL" = "true" || "$MAIN_BRANCH" = "true") && "$DOCS_ONLY" = "false" ]] && echo "true" || echo "false") | tee -a "$GITHUB_OUTPUT" + build-container: - if: ${{ needs.pre-flight.outputs.docs_only == 'false' && (github.event.label.name == 'Run CICD' || github.ref == 'refs/heads/main') }} + if: ${{ needs.pre-flight.outputs.run_ci == 'true' }} needs: [pre-flight] uses: NVIDIA/NeMo-FW-CI-templates/.github/workflows/_build_container.yml@v0.1.0 with: @@ -95,7 +98,7 @@ jobs: name: ${{ matrix.test_case }} needs: [build-container, pre-flight] uses: ./.github/workflows/_run_test.yml - if: needs.pre-flight.outputs.docs_only == 'false' || contains(fromJSON(needs.pre-flight.outputs.test_to_run), 'unit') || needs.pre-flight.outputs.all == 'true' + if: ${{ needs.pre-flight.outputs.run_ci == 'true' }} strategy: matrix: test_case: @@ -113,7 +116,7 @@ jobs: name: ${{ matrix.test_case }} needs: [build-container, pre-flight] uses: ./.github/workflows/_run_test.yml - if: needs.pre-flight.outputs.docs_only == 'false' || contains(fromJSON(needs.pre-flight.outputs.test_to_run), 'functional') || needs.pre-flight.outputs.all == 'true' + if: ${{ needs.pre-flight.outputs.run_ci == 'true' }} strategy: matrix: test_case: