-
Notifications
You must be signed in to change notification settings - Fork 727
✨feat: Add and update GitHub workflow for automated testing #3865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,109 @@ | ||
| name: Nexent Daily Full Test | ||
|
|
||
| on: | ||
| # Only workflow changes pushed/merged into develop trigger integration runs. | ||
| push: | ||
| branches: [develop] | ||
| paths: | ||
| - ".github/workflows/nexent-daily-full-test.yml" | ||
| workflow_dispatch: | ||
| # UTC 16:00 = Beijing 00:00 the following day. | ||
| schedule: | ||
| - cron: "0 16 * * *" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: nexent-daily-full-test | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| daily-full-test: | ||
| name: Daily D0-D6 | ||
| runs-on: [self-hosted, linux, x64] | ||
| # Includes up to 12 hours waiting for the local Daily lock. | ||
| timeout-minutes: 1440 | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| env: | ||
| TEST_ROOT: /home/jason/nexent-test-suite | ||
| REPO_ROOT: /root/project/nexent | ||
|
WMC001 marked this conversation as resolved.
|
||
|
|
||
| steps: | ||
| - name: Verify local test environment | ||
| run: | | ||
| set -euo pipefail | ||
| test -d "$TEST_ROOT/auto_test" | ||
| test -x "$TEST_ROOT/scripts/run-daily-suite.sh" | ||
| test -x "$TEST_ROOT/scripts/doctor.sh" | ||
| for file in daily.env secrets.env opencode-daily.jsonc opencode-analysis.jsonc; do | ||
| test -f "$TEST_ROOT/config/$file" | ||
| done | ||
| test -d "$REPO_ROOT/.git" | ||
| test -x /home/jason/.opencode/bin/opencode | ||
| for tool in git docker flock grep mktemp; do | ||
| command -v "$tool" >/dev/null | ||
| done | ||
| current_branch="$(git -C "$REPO_ROOT" branch --show-current)" | ||
| if [[ "$current_branch" != develop ]]; then | ||
| echo "Expected develop branch, found: $current_branch" >&2 | ||
| exit 2 | ||
| fi | ||
|
WMC001 marked this conversation as resolved.
|
||
| docker info >/dev/null | ||
| "$TEST_ROOT/scripts/doctor.sh" | ||
|
|
||
| - name: Run Nexent Daily D0-D6 | ||
| run: | | ||
| set -euo pipefail | ||
| umask 027 | ||
| workflow_log_root="$TEST_ROOT/runs/github-actions" | ||
| install -d -m 0750 "$workflow_log_root" | ||
| workflow_log="$workflow_log_root/run-${GITHUB_RUN_ID}-attempt-${GITHUB_RUN_ATTEMPT}.log" | ||
| { | ||
| echo "github_run_id=$GITHUB_RUN_ID" | ||
| echo "github_run_attempt=$GITHUB_RUN_ATTEMPT" | ||
| echo "github_event_name=$GITHUB_EVENT_NAME" | ||
| echo "github_ref=$GITHUB_REF" | ||
| echo "started_at=$(date -u +%Y-%m-%dT%H:%M:%SZ)" | ||
| } >"$workflow_log" | ||
|
|
||
| lock_wait_deadline=$((SECONDS + 43200)) | ||
| while true; do | ||
| # Each invocation has its own log: old lock messages cannot match. | ||
| attempt_log="$(mktemp "${workflow_log}.invocation.XXXXXX")" | ||
| set +e | ||
| "$TEST_ROOT/scripts/run-daily-suite.sh" \ | ||
| --repo "$REPO_ROOT" >"$attempt_log" 2>&1 | ||
| daily_status=$? | ||
| set -e | ||
| cat "$attempt_log" >>"$workflow_log" | ||
| echo "invocation_exit_code=$daily_status" >>"$workflow_log" | ||
|
WMC001 marked this conversation as resolved.
|
||
|
|
||
| if ((daily_status == 0)); then | ||
| echo "completed_at=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >>"$workflow_log" | ||
| break | ||
| fi | ||
| if ((daily_status == 3)) && | ||
| grep -qxF "another daily run is active" "$attempt_log"; then | ||
| if ((SECONDS >= lock_wait_deadline)); then | ||
| echo "Timed out waiting for local Daily. Log: $workflow_log" >&2 | ||
| exit 3 | ||
| fi | ||
| echo "Local Daily is active; retrying in 30 seconds." | ||
| sleep 30 | ||
| continue | ||
| fi | ||
| echo "Daily failed with exit code $daily_status. Log: $workflow_log" >&2 | ||
| exit "$daily_status" | ||
| done | ||
| echo "Daily completed. Local workflow log: $workflow_log" | ||
|
|
||
| - name: Show local result locations | ||
| if: always() | ||
| run: | | ||
| echo "No GitHub Artifact was uploaded." | ||
| echo "Daily runs: $TEST_ROOT/runs/daily/" | ||
| echo "Reports: $TEST_ROOT/reports/latest/" | ||
| echo "Workflow log: $TEST_ROOT/runs/github-actions/run-${GITHUB_RUN_ID}-attempt-${GITHUB_RUN_ATTEMPT}.log" | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -95,3 +95,4 @@ agent_repository_frontend | |
| .playwright-mcp/ | ||
| # Added by code-review-graph | ||
| .code-review-graph/ | ||
| .agents/ | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.