-
Notifications
You must be signed in to change notification settings - Fork 108
chore(ci): integration test schedule #199
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| # Run integration tests weekly and on-demand | ||
|
|
||
| name: Integration Tests | ||
|
|
||
| permissions: | ||
| contents: read | ||
| actions: write | ||
|
|
||
| on: | ||
| schedule: | ||
| # Run every Monday at 14:00 UTC | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potential mismatch between pinned action SHA and input support (setup-node) The workflow pins 🔧 Suggested fixPrefer using a released tag that supports the input, e.g. - uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
# or
- uses: actions/setup-node@v4
with:
node-version: '24'
cache: pnpmPinning to a stable release tag reduces the risk of using a commit SHA that lacks expected features. 🤖 Prompt for AI AgentsIn |
||
| - cron: "0 14 * * 1" | ||
| workflow_dispatch: # Allows triggering the workflow manually in GitHub UI | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Robustness: archive creation suppresses errors and may produce an empty/corrupt artifact The 🔧 Suggested fix- name: Create build archive
run: |
set -euo pipefail
FILES=()
for p in libs/*/dist libs/*/.turbo .turbo; do
if [ -e "$p" ]; then
FILES+=("$p")
fi
done
if [ ${#FILES[@]} -eq 0 ]; then
echo "No build artifacts found" >&2
exit 1
fi
tar -czf build-artifacts.tar.gz "${FILES[@]}"This avoids hiding errors and ensures a valid artifact is produced. Also remove redundant paths (e.g., 🤖 Prompt for AI AgentsIn There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Silent / suppressed archive creation failures (tar) The 🔧 Suggested fixReplace the single-line tar invocation with a robust script that: (1) uses strict shell flags, (2) checks which paths exist before archiving, and (3) exits non-zero with a clear error if nothing to archive. Example: - name: Create build archive
run: |
set -euo pipefail
trap 'echo "ERROR: archive creation failed at line $LINENO" >&2' ERR
FILES=()
for p in libs/*/dist libs/*/.turbo .turbo; do
[ -e "$p" ] && FILES+=("$p")
done
if [ ${#FILES[@]} -eq 0 ]; then
echo "No build artifacts found" >&2
exit 1
fi
tar -czf build-artifacts.tar.gz "${FILES[@]}"This ensures failures are visible and the artifact is valid before upload. 🤖 Prompt for AI AgentsIn |
||
| - name: Use Node.js | ||
| uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: "pnpm" | ||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
| - name: Build | ||
| run: pnpm build | ||
| - name: Create build archive | ||
| run: tar -czf build-artifacts.tar.gz libs/*/dist libs/*/.turbo .turbo 2>/dev/null || tar -czf build-artifacts.tar.gz libs/*/dist | ||
| - name: Upload build artifacts | ||
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v4 | ||
| with: | ||
| name: build-artifacts | ||
| path: build-artifacts.tar.gz | ||
| retention-days: 1 | ||
|
|
||
| test-int: | ||
| name: Integration Tests | ||
| needs: [build] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 | ||
| - name: Use Node.js 24.x | ||
| uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: "pnpm" | ||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
| - name: Download build artifacts | ||
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v4 | ||
| with: | ||
| name: build-artifacts | ||
| - name: Extract build artifacts | ||
| run: tar -xzf build-artifacts.tar.gz | ||
| - name: Run Integration Tests | ||
| run: pnpm test:int | ||
| env: | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | ||
| DENO_DEPLOY_TOKEN: ${{ secrets.DENO_DEPLOY_TOKEN }} | ||
| DAYTONA_API_KEY: ${{ secrets.DAYTONA_API_KEY }} | ||
| MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }} | ||
| MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overly-permissive workflow permission: actions: write
The workflow requests
actions: writeat the workflow-level permissions.actions: writegrants the workflow the ability to create or modify workflow runs and is broader than typically required for a scheduled integration job. Scheduled workflows that run with repository secrets should use least privilege to reduce risk.🔧 Suggested fix
If a specific step requires higher privileges, escalate permissions only for that job and document why.