Skip to content

refactor(pm): remove the test-only download wrapper #14758

refactor(pm): remove the test-only download wrapper

refactor(pm): remove the test-only download wrapper #14758

Workflow file for this run

name: Ecosystem CI
permissions: {}
on:
workflow_dispatch:
schedule:
# Run every day at 0:00 GMT (8:00 AM Singapore time)
- cron: '0 0 * * *'
push:
branches:
- main
paths-ignore:
- '**/*.md'
pull_request:
types: [opened, synchronize, labeled]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
defaults:
run:
shell: bash
jobs:
detect-changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
related-files-changed: ${{ steps.filter.outputs.related-files }}
steps:
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
id: filter
with:
filters: |
related-files:
- 'packages/**/build.ts'
- .github/workflows/e2e-test.yml
- .github/workflows/reusable-ecosystem-ci.yml
- 'ecosystem-ci/*'
download-previous-rolldown-binaries:
needs: detect-changes
runs-on: ubuntu-latest
# Run if: not a PR, OR PR has 'test: e2e' label, OR PR is from the deps/upstream-update or a renovate/** dependency branch, OR build.ts files changed
if: >-
github.event_name != 'pull_request' ||
contains(github.event.pull_request.labels.*.name, 'test: e2e') ||
github.head_ref == 'deps/upstream-update' ||
startsWith(github.head_ref, 'renovate/') ||
needs.detect-changes.outputs.related-files-changed == 'true'
permissions:
contents: read
packages: read
steps:
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
- uses: ./.github/actions/download-rolldown-binaries
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# Cross-compile the Windows vite-plus binding + vp binaries on Linux so the
# Windows package build only runs the (fast) JS/pack pass with
# skip-native, instead of the ~24m native Rust compile. The core/rolldown
# bundling stays on Windows (it is host-platform specific), so this can't be
# folded into the cross-compile job. Shares ci.yml's windows-cli-xwin cache.
build-windows-cli:
needs: detect-changes
if: >-
github.event_name != 'pull_request' ||
contains(github.event.pull_request.labels.*.name, 'test: e2e') ||
github.head_ref == 'deps/upstream-update' ||
startsWith(github.head_ref, 'renovate/') ||
needs.detect-changes.outputs.related-files-changed == 'true'
name: Build Windows CLI binaries
runs-on: namespace-profile-linux-x64-default
permissions:
contents: read
packages: read
steps:
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
- uses: ./.github/actions/clone
- uses: ./.github/actions/build-windows-cli
with:
profile: ci
save-cache: ${{ github.ref_name == 'main' }}
# Each platform starts its tests as soon as its own packages are ready.
# Linux does not consume the cross-compiled Windows binaries.
linux:
name: Linux ecosystem
needs: download-previous-rolldown-binaries
permissions:
contents: read
packages: read
uses: ./.github/workflows/reusable-ecosystem-ci.yml
with:
runner: ubuntu-latest
# Match the CLI cache producer's Rust toolchains and environment.
build-runner: namespace-profile-linux-x64-default
target: x86_64-unknown-linux-gnu
windows:
name: Windows ecosystem
needs:
- download-previous-rolldown-binaries
- build-windows-cli
permissions:
contents: read
packages: read
uses: ./.github/workflows/reusable-ecosystem-ci.yml
with:
runner: namespace-profile-windows-4c-8g
target: x86_64-pc-windows-msvc
notify-failure:
name: Notify on failure
runs-on: ubuntu-latest
needs: [linux, windows]
if: ${{ failure() && github.event_name == 'schedule' }}
permissions:
contents: read
issues: write
steps:
- name: Create or update GitHub issue on failure
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
run: |
ISSUE_TITLE="E2E Test Scheduled Run Failed"
ISSUE_LABEL="e2e-failure"
RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
# Create label if it doesn't exist
if ! gh label list --json name --jq '.[].name' | grep -q "^${ISSUE_LABEL}$"; then
CREATE_LABEL_OUTPUT=$(gh label create "$ISSUE_LABEL" --color "d73a4a" --description "E2E test scheduled run failure" 2>&1)
if [ $? -eq 0 ]; then
echo "Created label: $ISSUE_LABEL"
elif echo "$CREATE_LABEL_OUTPUT" | grep -qi "already exists"; then
echo "Label '$ISSUE_LABEL' already exists, continuing."
else
echo "Error: Failed to create label '$ISSUE_LABEL':"
echo "$CREATE_LABEL_OUTPUT" >&2
exit 1
fi
fi
# Search for existing open issue with the label
EXISTING_ISSUE=$(gh issue list --label "$ISSUE_LABEL" --state open --json number --jq '.[0].number')
if [ -z "$EXISTING_ISSUE" ]; then
# Create new issue if none exists
gh issue create \
--title "$ISSUE_TITLE" \
--label "$ISSUE_LABEL" \
--body "The scheduled E2E test run has failed.
**Failed Run:** $RUN_URL
**Time:** $(date -u '+%Y-%m-%d %H:%M:%S UTC')
Please investigate the failure and fix any issues."
echo "Created new issue"
else
# Add comment to existing issue
gh issue comment "$EXISTING_ISSUE" \
--body "The scheduled E2E test run has failed again.
**Failed Run:** $RUN_URL
**Time:** $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
echo "Added comment to issue #$EXISTING_ISSUE"
fi