-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1556 from annietllnd/pr-test-framework
Test framework update
- Loading branch information
Showing
41 changed files
with
1,156 additions
and
807 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Open Pull Request with updated stats report | ||
on: | ||
workflow_run: | ||
workflows: ["Test Learning Path"] | ||
types: [completed] | ||
permissions: | ||
actions: read | ||
contents: write | ||
pull-requests: write | ||
jobs: | ||
stats-pr: | ||
runs-on: ubuntu-24.04-arm | ||
steps: | ||
- name: Checkout main branch | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: main | ||
- name: Download stats report as artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
# Run ID of the workflow that uploaded the artifact | ||
run-id: ${{ github.event.workflow_run.id }} | ||
github-token: ${{ github.token }} | ||
- name: Move stats file | ||
# Unpack the artifact and move the stats file to the correct location | ||
run: | | ||
mv stats_current_test_info/stats_current_test_info.yml data/stats_current_test_info.yml | ||
rm -rf stats_current_test_info | ||
- name: Set workflow link as environment variable | ||
run: echo "WORKFLOW_URL=${{ github.event.workflow_run.workflow_url }}" >> $GITHUB_ENV | ||
- name: Echo Workflow URL | ||
run: echo $WORKFLOW_URL | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
if: success() | ||
with: | ||
commit-message: Update stats_current_test_info.yml | ||
title: Update stats_current_test_info.yml | ||
body: | | ||
Update test result file with recent run | ||
Triggered by workflow run ${ WORKFLOW_URL } | ||
Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request | ||
branch: update-stats-current-test-info | ||
base: main |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Test Learning Path | ||
on: pull_request | ||
jobs: | ||
Test-Pull-Request: | ||
runs-on: ubuntu-24.04-arm | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ steps.vars.outputs.branch-name }} | ||
- name: Get all changed markdown files | ||
id: changed-markdown-files | ||
uses: tj-actions/changed-files@v44 | ||
with: | ||
files: | | ||
**.md | ||
- name: Install dependencies | ||
if: steps.changed-markdown-files.outputs.any_changed == 'true' | ||
run: pip install -r tools/requirements.txt | ||
- name: Run test suite for all changed .md files | ||
id: run-suite | ||
if: steps.changed-markdown-files.outputs.any_changed == 'true' | ||
# Run the test suite | ||
run: | | ||
set -o pipefail; ./tools/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} 2>&1 | tee test-lp-output.txt | ||
- name: Parse test suite errors | ||
id: test-suite-state | ||
if: success() | ||
# Catch any missed errors if running multiple tests | ||
run: | | ||
cat test-lp-output.txt | grep -q 'Tests failed in test suite' && echo "TEST_SUITE_ERRORS=true" >> "$GITHUB_ENV" \ | ||
|| echo "TEST_SUITE_ERRORS=false" >> "$GITHUB_ENV" | ||
- name: Check for errors in test suite | ||
if: env.TEST_SUITE_ERRORS == 'true' && success() | ||
run: | | ||
echo "Test failures detected in test suite, check the output in earlier steps" | ||
exit 1 | ||
- name: Parse test maintenance off | ||
id: maintenance-state | ||
if: success() | ||
# Check if maintenance is turned off | ||
run: | | ||
cat test-lp-output.txt | grep -q 'maintenance is turned off' && echo "MAINTENANCE=off" >> "$GITHUB_ENV" \ | ||
|| echo "MAINTENANCE=on" >> "$GITHUB_ENV" | ||
- name: Check if maintenance is turned off | ||
if: env.MAINTENANCE == 'off' && success() | ||
run: echo "Maintenance is turned off for one or more files" | ||
# Only upload artifact if maintenance is on | ||
- name: Upload stats artifact | ||
uses: actions/upload-artifact@v4 | ||
if: success() && env.MAINTENANCE == 'on' | ||
with: | ||
name: stats_current_test_info | ||
path: data/stats_current_test_info.yml |
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ resources/ | |
node_modules/ | ||
package-lock.json | ||
.hugo_build.lock | ||
.vscode | ||
|
||
# macOS files | ||
*.DS_Store | ||
|
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
Oops, something went wrong.