Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/bundle-size-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ on:
jobs:
comment:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'microsoft' && github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
# upstream repo + the fork used to validate large migrations before they are opened upstream
if: ${{ (github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev') && github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
permissions:
pull-requests: write
# `actions/checkout` + `actions/download-artifact` (cross run) need these explicitly, since
# declaring a `permissions` block sets every unlisted scope to `none`
contents: read
actions: read
steps:
- uses: actions/checkout@v6
with:
Expand Down
36 changes: 31 additions & 5 deletions .github/workflows/bundle-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ concurrency:
cancel-in-progress: true

env:
NX_PARALLEL: 6 # ubuntu-latest = 4-core CPU / 16 GB of RAM | macos-14-xlarge (arm) = 6-core CPU / 14 GB of RAM
NX_PREFER_TS_NODE: true
# Keep the upstream larger-runner tuning; leave one core free on the fork's Ubuntu runner.
NX_PARALLEL: ${{ github.repository_owner == 'mainframev' && '3' || '6' }}
NX_VERBOSE_LOGGING: true

BROWSERSLIST_IGNORE_OLD_DATA: true

jobs:
bundle-size:
if: ${{ github.repository_owner == 'microsoft' }}
runs-on: macos-14-xlarge
# upstream repo + the fork used to validate large migrations before they are opened upstream
if: ${{ github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev' }}
runs-on: ${{ github.repository_owner == 'mainframev' && 'ubuntu-latest' || 'macos-14-xlarge' }}
timeout-minutes: 180
permissions:
contents: 'read'
actions: 'read'
Expand Down Expand Up @@ -52,9 +54,33 @@ jobs:

- name: Compare bundle size with base
if: ${{ github.event.pull_request.base.ref == 'master' }}
run: npx monosize compare-reports --branch=${{ github.event.pull_request.base.ref }} --output=markdown --quiet > ./monosize-report.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# passed via env (not inlined into the script) so nothing from the event payload is
# evaluated by the shell
BASE_REF: ${{ github.event.pull_request.base.ref }}
REPOSITORY: ${{ github.repository }}
# base reports are read from the `microsoft/fluentui` "Bundle size Base" artifacts
# (see `storage` in monosize.config.mjs). A fork's GITHUB_TOKEN cannot read those, so a
# missing/unreachable baseline must not fail PR validation there - upstream keeps failing hard.
ALLOW_MISSING_BASE_REPORT: ${{ github.repository != 'microsoft/fluentui' }}
run: |
if npx monosize compare-reports --branch="$BASE_REF" --output=markdown --quiet > ./monosize-report.md; then
exit 0
fi

if [ "$ALLOW_MISSING_BASE_REPORT" != 'true' ]; then
echo "::error::'monosize compare-reports' failed."
exit 1
fi

echo "::warning::Bundle size comparison unavailable - the base report published by 'microsoft/fluentui' is not readable from '$REPOSITORY'. The bundle-size builds themselves passed."
{
printf '### 📦 Bundle size\n\n'
printf 'Bundle size **builds passed**, but no comparison could be produced.\n\n'
printf 'Baseline reports are published by the `Bundle size Base` workflow of '
printf '`microsoft/fluentui` and are not readable from `%s`.\n' "$REPOSITORY"
} > ./monosize-report.md

- name: Save PR number
if: ${{ github.event.pull_request.base.ref == 'master' }}
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/check-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
jobs:
dependency-deduplication:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'microsoft' }}
# upstream repo + the fork used to validate large migrations before they are opened upstream
if: ${{ github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev' }}
steps:
- uses: actions/checkout@v6
with:
Expand Down Expand Up @@ -38,7 +39,8 @@ jobs:

dependency-mismatches:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'microsoft' }}
# upstream repo + the fork used to validate large migrations before they are opened upstream
if: ${{ github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev' }}
steps:
- uses: actions/checkout@v6
with:
Expand All @@ -65,7 +67,8 @@ jobs:

change-files:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'microsoft' }}
# upstream repo + the fork used to validate large migrations before they are opened upstream
if: ${{ github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev' }}
steps:
- uses: actions/checkout@v6
with:
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/check-tooling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ env:

jobs:
check-tools:
if: ${{ github.repository_owner == 'microsoft' }}
# upstream repo + the fork used to validate large migrations before they are opened upstream
if: ${{ github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev' }}
strategy:
matrix:
# both are GitHub hosted runners, no change needed for fork validation
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
with:
Expand All @@ -39,12 +42,16 @@ jobs:
# pre-build react-jsx-runtime - as generate-api executor doesn't provide copy assets capability
- run: yarn nx run react-jsx-runtime:build

- run: yarn nx g @fluentui/workspace-plugin:react-library --name hello-world --owner '@microsoft/fluentui-react-build' --kind standard --no-interactive
# The workflow validates generated files and follow-on generators after installing above.
# Avoid a redundant native dependency rebuild on the smaller Ubuntu runner.
- run: yarn nx g @fluentui/workspace-plugin:react-library --name hello-world --owner '@microsoft/fluentui-react-build' --kind standard --skip-install=${{ github.repository_owner == 'mainframev' }} --no-interactive
- run: yarn nx g @fluentui/workspace-plugin:react-component --project hello-world-preview --name Aiur --no-interactive
- run: yarn nx g @fluentui/workspace-plugin:cypress-component-configuration --project hello-world-preview --no-interactive
- run: yarn nx g @fluentui/workspace-plugin:bundle-size-configuration --project hello-world-preview --no-interactive
- run: yarn nx g @fluentui/workspace-plugin:prepare-initial-release --project hello-world-preview --phase=preview --no-interactive
- run: yarn nx g @fluentui/workspace-plugin:prepare-initial-release --project hello-world-preview --phase=stable --no-interactive
# API generation resolves the newly stable package through its workspace link, which is created
# by the install skipped on the fork. Upstream retains the complete post-generation validation.
- run: yarn nx g @fluentui/workspace-plugin:prepare-initial-release --project hello-world-preview --phase=stable --skip-install=${{ github.repository_owner == 'mainframev' }} --skip-generate-api=${{ github.repository_owner == 'mainframev' }} --no-interactive
- run: yarn nx g @nx/workspace:remove --project hello-world --forceRemove --no-interactive
- run: yarn nx g @nx/workspace:remove --project hello-world-stories --forceRemove --no-interactive
- run: yarn nx g @fluentui/workspace-plugin:tsconfig-base-all --no-interactive
10 changes: 7 additions & 3 deletions .github/workflows/pr-vrt-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ on:
- completed

env:
NX_PARALLEL: 4 # ubuntu-latest = 4-core CPU / 16 GB of RAM | macos-14-xlarge (arm) = 6-core CPU / 14 GB of RAM
NX_PREFER_TS_NODE: true
# this workflow runs on `ubuntu-latest` = 4-core CPU / 16 GB of RAM
NX_PARALLEL: 4
NX_VERBOSE_LOGGING: true

jobs:
run_vr_diff:
runs-on: ubuntu-latest
# NOTE: intentionally upstream only - the VR approval CLI authenticates against Azure via OIDC
# (`AZURE_VRT_CLIENT_ID`/`AZURE_TENANT_ID`/`AZURE_SUBSCRIPTION_ID`) and writes to the shared
# baseline storage. Forks do not have those secrets, so this stays skipped there instead of
# failing PR validation - screenshot *generation* is still validated by `pr-vrt.yml`.
if: ${{ github.repository_owner == 'microsoft' && github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
permissions:
# necessary to write comments to the PR from the vr-approval-cli
Expand All @@ -28,7 +32,7 @@ jobs:

# downloaded artifacts will contain screenshots from affected project including 'screenshots-report.json' which contains proper image mappings for affected project
# - see @{link file://./../scripts/prepare-vr-screenshots-for-upload.js#45}
# - see @{link file://./pr-vrt.yml#56}
# - see @{link file://./pr-vrt.yml#80}

- uses: actions/download-artifact@v7
with:
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/pr-vrt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ concurrency:
cancel-in-progress: true

env:
NX_PARALLEL: 6 # ubuntu-latest = 4-core CPU / 16 GB of RAM | macos-14-xlarge (arm) = 6-core CPU / 14 GB of RAM
NX_PREFER_TS_NODE: true
# Keep the upstream larger-runner tuning; limit memory-heavy Storybook/Playwright work on the fork.
NX_PARALLEL: ${{ github.repository_owner == 'mainframev' && '2' || '6' }}
NX_VERBOSE_LOGGING: true

permissions:
Expand All @@ -21,10 +21,12 @@ permissions:

jobs:
generate_vrt_screenshots:
if: ${{ github.repository_owner == 'microsoft' }}
runs-on: macos-14-xlarge
# upstream repo + the fork used to validate large migrations before they are opened upstream
if: ${{ github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev' }}
# The fork validates screenshot generation on Ubuntu. Upstream stays on macOS to match its baseline.
runs-on: ${{ github.repository_owner == 'mainframev' && 'ubuntu-latest' || 'macos-14-xlarge' }}
name: Generate screenshots
timeout-minutes: 60
timeout-minutes: 120
steps:
- uses: actions/checkout@v6
with:
Expand All @@ -40,6 +42,14 @@ jobs:
cache: 'yarn'
node-version: '22'

# storybook builds + playwright browsers do not fit next to the preinstalled SDKs of the image
- name: Free up runner disk space
if: ${{ github.repository_owner == 'mainframev' }}
run: |
df -h /
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL || true
df -h /

- run: yarn install --frozen-lockfile
- run: yarn playwright install --with-deps

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pr-website-deploy-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ env:
jobs:
deploy:
runs-on: ubuntu-latest
# NOTE: intentionally upstream only - uploading to the `fluentuipr` storage account requires the
# Azure OIDC credentials (`AZURE_CLIENT_ID`/`AZURE_TENANT_ID`/`AZURE_SUBSCRIPTION_ID`), which do
# not exist in forks. Keeping it skipped there (the dependent `comment` job is skipped with it)
# means PR validation is not failed by a missing deployment target - the website artifact itself
# is still built and validated by `pr-website-deploy.yml`.
if: ${{ github.repository_owner == 'microsoft' && github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
outputs:
pr_number: ${{ steps.pr_number.outputs.result }}
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/pr-website-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@ concurrency:
cancel-in-progress: true

env:
NX_PARALLEL: 6 # ubuntu-latest = 4-core CPU / 16 GB of RAM | macos-14-xlarge (arm) = 6-core CPU / 14 GB of RAM
NX_PREFER_TS_NODE: true
# Keep the upstream larger-runner tuning; limit memory-heavy webpack work on the fork.
NX_PARALLEL: ${{ github.repository_owner == 'mainframev' && '2' || '6' }}
NX_VERBOSE_LOGGING: true

BROWSERSLIST_IGNORE_OLD_DATA: true

jobs:
bundle:
if: ${{ github.repository_owner == 'microsoft' }}
runs-on: macos-14-xlarge
# upstream repo + the fork used to validate large migrations before they are opened upstream.
# NOTE: this job only *builds* the PR website artifact - uploading it to Azure happens in
# `pr-website-deploy-comment.yml`, which stays upstream only (needs Azure credentials).
if: ${{ github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev' }}
runs-on: ${{ github.repository_owner == 'mainframev' && 'ubuntu-latest' || 'macos-14-xlarge' }}
timeout-minutes: 240
permissions:
contents: 'read'
actions: 'read'
Expand All @@ -41,6 +45,14 @@ jobs:
- name: NodeJS heap default size
run: node -e 'console.log(v8.getHeapStatistics().heap_size_limit / 1024 / 1024 + " MB");'

# bundles + storybook builds of the whole workspace do not fit next to the preinstalled SDKs
- name: Free up runner disk space
if: ${{ github.repository_owner == 'mainframev' }}
run: |
df -h /
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL || true
df -h /

- run: yarn install --frozen-lockfile

- name: Install Playwright Browsers
Expand Down
Loading
Loading