Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 45 additions & 5 deletions .github/workflows/cicd-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ permissions:
contents: read

jobs:
pre-flight:
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_cicd_preflight.yml@v0.64.2

cicd-wait-in-queue:
needs: [pre-flight]
runs-on: ubuntu-latest
environment: test
if: |
needs.pre-flight.outputs.is_ci_workload == 'false'
&& needs.pre-flight.outputs.docs_only == 'false'
steps:
- name: Running CI tests
run: |
Expand Down Expand Up @@ -62,10 +68,17 @@ jobs:
runner: linux-amd64-cpu16
timeout: 30
cpu-only: true
needs: [cicd-container-build]
needs: [pre-flight, cicd-container-build]
runs-on: ${{ matrix.runner }}
name: ${{ matrix.script }}
environment: nemo-ci
if: |
(
success()
|| needs.pre-flight.outputs.is_ci_workload == 'true'
|| needs.pre-flight.outputs.force_run_all == 'true'
)
&& !cancelled()
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -85,9 +98,17 @@ jobs:

Nemo_CICD_Test:
needs:
- pre-flight
- cicd-container-build
- cicd-unit-tests
if: always()
if: |
(
needs.pre-flight.outputs.docs_only == 'true'
|| needs.pre-flight.outputs.is_deployment_workflow == 'true'
|| needs.pre-flight.outputs.is_ci_workload == 'true'
|| always()
)
&& !cancelled()
runs-on: ubuntu-latest
permissions: write-all
steps:
Expand All @@ -99,13 +120,15 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
RUN_ID: ${{ github.run_id }}
DOCS_ONLY: ${{ needs.pre-flight.outputs.docs_only }}
IS_DEPLOYMENT: ${{ needs.pre-flight.outputs.is_deployment_workflow }}
IS_CI_WORKLOAD: ${{ needs.pre-flight.outputs.is_ci_workload }}
run: |
# Get workflow run details and check job conclusions
LATEST_ATTEMPT=$(gh run view $RUN_ID --json jobs -q '[.jobs[] | select(.conclusion != null) | .conclusion] | last')
NUM_FAILED=$(gh run view $RUN_ID --json jobs -q '[.jobs[] | select(.conclusion == "failure") | .name] | length')
NUM_CANCELLED=$(gh run view $RUN_ID --json jobs -q '[.jobs[] | select(.conclusion == "cancelled") | .name] | length')

if [[ $NUM_FAILED -eq 0 && $NUM_CANCELLED -eq 0 ]]; then
if [[ ($NUM_FAILED -eq 0 && $NUM_CANCELLED -eq 0) || $DOCS_ONLY == 'true' || $IS_DEPLOYMENT == 'true' || $IS_CI_WORKLOAD == 'true' ]]; then
RESULT="success"
elif [[ $NUM_CANCELLED -gt 0 ]]; then
RESULT="cancelled"
Expand Down Expand Up @@ -182,7 +205,14 @@ jobs:

Coverage:
runs-on: ubuntu-latest
needs: [Nemo_CICD_Test]
needs: [pre-flight, Nemo_CICD_Test]
if: |
needs.pre-flight.outputs.docs_only == 'false'
&& (
success()
|| needs.Nemo_CICD_Test.result == 'success'
)
&& !cancelled()
strategy:
matrix:
flag: [unit-test]
Expand Down Expand Up @@ -222,3 +252,13 @@ jobs:
path: |
.coverage
include-hidden-files: true

codecov-placeholder:
name: codecov/patch
needs: [pre-flight]
if: needs.pre-flight.outputs.docs_only == 'true'
runs-on: ubuntu-latest
steps:
- name: codecov_placeholder
run: |
echo "This is a placeholder status check for when no tests are ran but the codecov status is expected"