Skip to content

Commit 20b2901

Browse files
feat: add nightly E2E workflow for sandbox testing and configuration validation
1 parent 347cdf4 commit 20b2901

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

.github/workflows/nightly.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Sandbox Nightly E2E
2+
3+
on:
4+
schedule:
5+
- cron: '0 3 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
nightly-pr:
10+
runs-on: ubuntu-latest
11+
env:
12+
SANDBOX_REPO: ${{ secrets.SANDBOX_REPO }}
13+
SANDBOX_TOKEN: ${{ secrets.SANDBOX_TOKEN }}
14+
steps:
15+
- name: Check sandbox configuration
16+
id: check
17+
env:
18+
SANDBOX_TRACK: ${{ vars.SANDBOX_TRACK }}
19+
SANDBOX_DEFAULT_BRANCH: ${{ vars.SANDBOX_DEFAULT_BRANCH }}
20+
SANDBOX_AUTOMERGE: ${{ vars.SANDBOX_AUTOMERGE }}
21+
run: |
22+
if [ -z "${SANDBOX_REPO}" ] || [ -z "${SANDBOX_TOKEN}" ]; then
23+
echo "### Sandbox nightly" >> "$GITHUB_STEP_SUMMARY"
24+
echo "Sandbox secrets are not configured so the nightly run was skipped." >> "$GITHUB_STEP_SUMMARY"
25+
echo "configured=false" >> "$GITHUB_OUTPUT"
26+
exit 0
27+
fi
28+
29+
TRACK=${SANDBOX_TRACK:-3.11}
30+
BRANCH=${SANDBOX_DEFAULT_BRANCH:-main}
31+
AUTOMERGE=${SANDBOX_AUTOMERGE:-false}
32+
33+
echo "configured=true" >> "$GITHUB_OUTPUT"
34+
echo "track=$TRACK" >> "$GITHUB_OUTPUT"
35+
echo "branch=$BRANCH" >> "$GITHUB_OUTPUT"
36+
echo "automerge=$AUTOMERGE" >> "$GITHUB_OUTPUT"
37+
- uses: actions/checkout@v4
38+
if: steps.check.outputs.configured == 'true'
39+
- uses: actions/setup-node@v4
40+
if: steps.check.outputs.configured == 'true'
41+
with:
42+
node-version: 20
43+
- name: Install dependencies
44+
if: steps.check.outputs.configured == 'true'
45+
run: npm ci
46+
- name: Build TypeScript
47+
if: steps.check.outputs.configured == 'true'
48+
run: npm run build
49+
- name: Bundle action
50+
if: steps.check.outputs.configured == 'true'
51+
run: npm run bundle
52+
- name: Clone sandbox repository
53+
if: steps.check.outputs.configured == 'true'
54+
env:
55+
TARGET_BRANCH: ${{ steps.check.outputs.branch }}
56+
run: |
57+
git clone https://x-access-token:${SANDBOX_TOKEN}@github.com/${SANDBOX_REPO}.git sandbox
58+
cd sandbox
59+
git checkout "$TARGET_BRANCH"
60+
- name: Run CPython Patch PR Action
61+
id: bump
62+
if: steps.check.outputs.configured == 'true'
63+
uses: ./
64+
with:
65+
track: ${{ steps.check.outputs.track }}
66+
dry_run: false
67+
automerge: ${{ steps.check.outputs.automerge }}
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.SANDBOX_TOKEN }}
70+
working-directory: sandbox
71+
- name: Summarize run
72+
if: steps.check.outputs.configured == 'true'
73+
env:
74+
TARGET_BRANCH: ${{ steps.check.outputs.branch }}
75+
TARGET_TRACK: ${{ steps.check.outputs.track }}
76+
TARGET_AUTOMERGE: ${{ steps.check.outputs.automerge }}
77+
run: |
78+
echo "### Sandbox nightly" >> "$GITHUB_STEP_SUMMARY"
79+
echo "- Repository: ${SANDBOX_REPO}" >> "$GITHUB_STEP_SUMMARY"
80+
echo "- Branch: ${TARGET_BRANCH}" >> "$GITHUB_STEP_SUMMARY"
81+
echo "- Track: ${TARGET_TRACK}" >> "$GITHUB_STEP_SUMMARY"
82+
echo "- Automerge: ${TARGET_AUTOMERGE}" >> "$GITHUB_STEP_SUMMARY"
83+
echo "- Files changed: ${{ steps.bump.outputs.files_changed }}" >> "$GITHUB_STEP_SUMMARY"
84+
echo "- Skipped reason: ${{ steps.bump.outputs.skipped_reason }}" >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)