-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Terry Kong <[email protected]> Signed-off-by: ashors1 <[email protected]> Signed-off-by: Oliver Koenig <[email protected]> Signed-off-by: oliver könig <[email protected]> Co-authored-by: Anna Shors <[email protected]> Co-authored-by: oliver könig <[email protected]>
- Loading branch information
1 parent
f817eb1
commit b025619
Showing
6 changed files
with
114 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ jobs: | |
outputs: | ||
test_to_run: ${{ steps.test_to_run.outputs.main }} | ||
all: ${{ steps.all.outputs.main }} | ||
run_ci: ${{ steps.evaluate.outputs.run_ci }} | ||
steps: | ||
- name: Parse test_to_run | ||
id: test_to_run | ||
|
@@ -51,23 +52,57 @@ jobs: | |
id: all | ||
run: | | ||
echo "main=${{ contains(fromJSON(steps.test_to_run.outputs.main), 'all') }}" | tee -a "$GITHUB_OUTPUT" | ||
- name: Get changed files | ||
id: changed-files | ||
if: github.event_name == 'pull_request' | ||
uses: tj-actions/changed-files@v44 | ||
with: | ||
files_yaml: | | ||
doc: | ||
- '**.md' | ||
- docs/** | ||
src: | ||
- '!**.md' | ||
- '!docs/**' | ||
- name: Evaluate conditions | ||
id: evaluate | ||
env: | ||
DOCS_ONLY: ${{ steps.changed-files.outputs.doc_any_changed == 'true' && steps.changed-files.outputs.src_any_changed == 'false' }} | ||
CHANGED_DOCS: ${{ steps.changed-files.outputs.doc_all_changed_files }} | ||
CHANGED_SRC: ${{ steps.changed-files.outputs.src_all_changed_files }} | ||
IS_PULLREQUEST: ${{ github.event_name == 'pull_request' }} | ||
LABEL: ${{ github.event.label.name == 'Run CICD' }} | ||
run: | | ||
# Some output that's helpful for debugging | ||
echo "Docs changed: $CHANGED_DOCS" | ||
echo "Src changed: $CHANGED_SRC" | ||
echo "DOCS_ONLY: $DOCS_ONLY" | ||
echo "LABEL: $LABEL" | ||
echo "IS_PULLREQUEST: $IS_PULLREQUEST" | ||
# Run CI only (on main or if label is attached) and if it's not only docs | ||
echo run_ci=$([[ ("$LABEL" = "true" || "$IS_PULLREQUEST" = "false") && "$DOCS_ONLY" = "false" ]] && echo "true" || echo "false") | tee -a "$GITHUB_OUTPUT" | ||
build-container: | ||
if: ${{ 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/[email protected] | ||
with: | ||
image-name: nemo_aligner_container | ||
dockerfile: Dockerfile | ||
image-label: nemo-aligner | ||
build-args: | | ||
MAX_JOBS=32 | ||
ALIGNER_COMMIT=${{ github.event.pull_request.head.sha || github.sha }} | ||
ALIGNER_COMMIT=${{ github.sha }} | ||
Unit_Tests: | ||
name: ${{ matrix.test_case }} | ||
needs: [build-container, pre-flight] | ||
uses: ./.github/workflows/_run_test.yml | ||
if: 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: | ||
|
@@ -85,7 +120,7 @@ jobs: | |
name: ${{ matrix.test_case }} | ||
needs: [build-container, pre-flight] | ||
uses: ./.github/workflows/_run_test.yml | ||
if: 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: | ||
|
@@ -104,3 +139,24 @@ jobs: | |
TIMEOUT: 10 | ||
SCRIPT: | | ||
bash /opt/NeMo-Aligner/tests/functional/test_cases/${{ matrix.test_case }} | ||
CI_QA_Gate: | ||
name: CI quality check | ||
if: always() | ||
runs-on: ubuntu-latest | ||
needs: | ||
- Unit_Tests | ||
- Functional_Tests | ||
steps: | ||
- name: main | ||
env: | ||
JOB_RESULTS: ${{ toJSON(needs) }} | ||
ALL_SUCCESS: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && !contains(needs.*.result, 'skipped') }} | ||
CI_SKIP: ${{ github.event.label.name == 'Skip CICD' }} | ||
run: | | ||
SUMMARY=$(echo $JOB_RESULTS | jq 'to_entries[] | .key + ": " + .value.result' | tr -d '"') | ||
echo '🤖: CICD Result' >> $GITHUB_STEP_SUMMARY | ||
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY | ||
test "$ALL_SUCCESS" = "true" || test "$CI_SKIP" = "true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters