Sandbox Nightly E2E #14
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
| name: Sandbox Nightly E2E | |
| on: | |
| schedule: | |
| - cron: '0 3 * * 1' | |
| workflow_dispatch: | |
| jobs: | |
| nightly-pr: | |
| runs-on: ubuntu-latest | |
| env: | |
| SANDBOX_REPO: ${{ secrets.SANDBOX_REPO }} | |
| SANDBOX_TOKEN: ${{ secrets.SANDBOX_TOKEN }} | |
| steps: | |
| - name: Check sandbox configuration | |
| id: check | |
| env: | |
| SANDBOX_TRACK: ${{ vars.SANDBOX_TRACK }} | |
| SANDBOX_DEFAULT_BRANCH: ${{ vars.SANDBOX_DEFAULT_BRANCH }} | |
| SANDBOX_AUTOMERGE: ${{ vars.SANDBOX_AUTOMERGE }} | |
| run: | | |
| if [ -z "${SANDBOX_REPO}" ] || [ -z "${SANDBOX_TOKEN}" ]; then | |
| echo "### Sandbox nightly" >> "$GITHUB_STEP_SUMMARY" | |
| echo "Sandbox secrets are not configured so the nightly run was skipped." >> "$GITHUB_STEP_SUMMARY" | |
| echo "configured=false" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| TRACK=${SANDBOX_TRACK:-3.13} | |
| BRANCH=${SANDBOX_DEFAULT_BRANCH:-main} | |
| AUTOMERGE=${SANDBOX_AUTOMERGE:-false} | |
| echo "configured=true" >> "$GITHUB_OUTPUT" | |
| echo "track=$TRACK" >> "$GITHUB_OUTPUT" | |
| echo "branch=$BRANCH" >> "$GITHUB_OUTPUT" | |
| echo "automerge=$AUTOMERGE" >> "$GITHUB_OUTPUT" | |
| - uses: actions/checkout@v5 | |
| if: steps.check.outputs.configured == 'true' | |
| - uses: actions/setup-node@v6 | |
| if: steps.check.outputs.configured == 'true' | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| if: steps.check.outputs.configured == 'true' | |
| run: npm ci | |
| - name: Build TypeScript | |
| if: steps.check.outputs.configured == 'true' | |
| run: npm run build | |
| - name: Bundle action | |
| if: steps.check.outputs.configured == 'true' | |
| run: npm run bundle | |
| - name: Checkout sandbox repository | |
| if: steps.check.outputs.configured == 'true' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ env.SANDBOX_REPO }} | |
| ref: ${{ steps.check.outputs.branch }} | |
| path: sandbox | |
| token: ${{ secrets.SANDBOX_TOKEN }} | |
| - name: Run CPython Patch PR Action | |
| id: bump | |
| if: steps.check.outputs.configured == 'true' | |
| uses: ./ | |
| with: | |
| track: ${{ steps.check.outputs.track }} | |
| dry_run: false | |
| automerge: ${{ steps.check.outputs.automerge }} | |
| paths: | | |
| sandbox/** | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.SANDBOX_TOKEN }} | |
| - name: Summarize run | |
| if: steps.check.outputs.configured == 'true' | |
| env: | |
| TARGET_BRANCH: ${{ steps.check.outputs.branch }} | |
| TARGET_TRACK: ${{ steps.check.outputs.track }} | |
| TARGET_AUTOMERGE: ${{ steps.check.outputs.automerge }} | |
| run: | | |
| echo "### Sandbox nightly" >> "$GITHUB_STEP_SUMMARY" | |
| echo "- Repository: ${SANDBOX_REPO}" >> "$GITHUB_STEP_SUMMARY" | |
| echo "- Branch: ${TARGET_BRANCH}" >> "$GITHUB_STEP_SUMMARY" | |
| echo "- Track: ${TARGET_TRACK}" >> "$GITHUB_STEP_SUMMARY" | |
| echo "- Automerge: ${TARGET_AUTOMERGE}" >> "$GITHUB_STEP_SUMMARY" | |
| echo "- Files changed: ${{ steps.bump.outputs.files_changed }}" >> "$GITHUB_STEP_SUMMARY" | |
| echo "- Skipped reason: ${{ steps.bump.outputs.skipped_reason }}" >> "$GITHUB_STEP_SUMMARY" |