Skip to content
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

ci: use nx for task orchestration for build/test/lint/type-check #26928

Draft
wants to merge 44 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a7128cc
ci: use nx for task orchestration for build/test/lint/type-check
Hotell Feb 21, 2023
ceaf32e
chore: migrate to nx 14.0.0
Hotell Feb 22, 2023
c78495b
chore: migrate to nx 14.8.6
Hotell Feb 22, 2023
e4eaaee
chore: migrate to nx 15.0.0
Hotell Feb 22, 2023
c5941ff
chore: migrate to nx 15.6.3
Hotell Feb 22, 2023
5751c03
chore: update run-affected with multiple targets api supported in nx …
Hotell Feb 22, 2023
d3044aa
chore: dedup deps after rebase including jest 28
Hotell Mar 1, 2023
eeaaee9
chore: remove lint target dependency on build for nx
Hotell Mar 1, 2023
af065e5
chore: migrate to node 16
Hotell Mar 1, 2023
9ee4b0b
chore: bump to node 16.18.1 to be aligned with codesandbox CI
Hotell Mar 1, 2023
6db952a
fix(scripts-generators): lint issues caused by nx migrations
Hotell Mar 1, 2023
d9f52d5
fix(global-context): remove non-existend NodeJS.Glob after node 16 ty…
Hotell Mar 1, 2023
daa4760
ci: run nx for all projects for better metrics
Hotell Mar 1, 2023
0d87151
chore(nx): update targetDefaults to match lage.config
Hotell Mar 1, 2023
bf95c6a
chore: migrate to nx 15.8.1 (introducing project.json migration with …
Hotell Mar 2, 2023
d7a4ba5
chore: migrate to nx 15.8.3
Hotell Mar 3, 2023
3d5a2ee
chore: migrate to nx 15.8.5
Hotell Mar 6, 2023
aa9b990
ci: add new job PR to get more data
Hotell Mar 6, 2023
af847c1
feat(react-conformance): add new TS config api to be able to specify …
Hotell Mar 7, 2023
8d9e976
chore(react-conformance): hardcode resolving proper tsconfig for conf…
Hotell Mar 7, 2023
8daa600
chore(react-components): use swc/jest for tests
Hotell Mar 7, 2023
74f3b8f
chore(react): remove unused common/ code and simplify eslint config t…
Hotell Mar 8, 2023
e11b84c
ci: try fixing yarn install
Hotell Mar 8, 2023
ac3e3de
ci: narrow down pipelines to get nx vs lage comparison
Hotell Mar 8, 2023
d5e14af
test: improve jest execution speeds by removing -i and --coverage fro…
Hotell Mar 9, 2023
22465fb
test: try using maxworkers for v9 to improve jest execution speeds on CI
Hotell Mar 9, 2023
5b5d854
test: use isolatedModules for all ts-jest configs to lower memory foo…
Hotell Mar 9, 2023
ac47f2a
feat: integrate lerna with nx
Hotell Mar 9, 2023
202a3a7
chore(lage): remove redundant task dependency config
Hotell Mar 9, 2023
3ee08f6
feat(scripts/tasks): implement type-check command to improve type che…
Hotell Mar 10, 2023
fa998f0
chore: use ts-solution config for v8 and emit only declaration in v0 …
Hotell Mar 14, 2023
fd37bce
chore(scripts-tasks): disable path aliases when running build task fo…
Hotell Mar 15, 2023
341df5e
chore(scripts-tasks): improve copy-comiled task execution by 99%
Hotell Mar 15, 2023
e180086
chore(vr-tests): remove 'build' task for vr-tests to unify and not ru…
Hotell Mar 15, 2023
0a1e2dd
ci: add logs to determine what's wrong with yarn install
Hotell Mar 15, 2023
6dbc149
chore(fluentui/e2e): speedup ts processing and make it work with no-b…
Hotell Mar 16, 2023
e784acb
ci: add new pipeline for only e2e without all deps build needed
Hotell Mar 16, 2023
2a847fc
chore(react-18-tests-v8): make e2e work withou no-build DX
Hotell Mar 17, 2023
9624833
ci: create gha for PR
Hotell Mar 20, 2023
1455d09
fix(scripts-storybook): update loadWorkspaceAddon template to call va…
Hotell Mar 21, 2023
d2ccd21
test(fluentui/react): fix initial global leaks that were causing OOM …
Hotell Mar 22, 2023
4e11c94
chore: migrate to nx 15.8.7
Hotell Mar 23, 2023
f49121b
ci(ado): add nx affected pipeline for testing
Hotell Mar 23, 2023
1f0b7cc
docs: push perf docs
Hotell Mar 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"buildCommand": "build:codesandbox",
Copy link
Collaborator

@fabricteam fabricteam Mar 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵 fluentuiv8 Open the Visual Regressions report to inspect the 2 screenshots

✅ There was 2 screenshots added, 0 screenshots removed, 1045 screenshots unchanged, 0 screenshots with different dimensions and 0 screenshots with visible difference.

unknown 2 screenshots
Image Name Diff(in Pixels) Image Type
Pivot - Overflow.Tabs - RTL.Narrow - Last tab selected.chromium.png 0 Added
Pivot - Overflow.Tabs - RTL.Narrow - Overflow menu.chromium.png 0 Added

"packages": ["packages/react", "packages/react-components/react-components"],
"sandboxes": ["x5u3t", "spnyu"],
"node": "14"
"node": "16"
}
2 changes: 1 addition & 1 deletion .devops/templates/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: '14.18.1'
versionSpec: '16.18.1'
checkLatest: false
displayName: 'Install Node.js'

Expand Down
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@

#### NX related files
/nx.json @microsoft/fluentui-react-build
/workspace.json @microsoft/fluentui-react-build
/migrations.json @microsoft/fluentui-react-build


#### Meta and License stuff
/LICENSE @microsoft/fluentui-react-build @justSlone @jurokapsiar @tudorpopams
/packages/react/LICENSE @microsoft/fluentui-react-build @justSlone @jurokapsiar @tudorpopams
Expand Down Expand Up @@ -293,3 +293,4 @@ packages/react-experiments/src/components/TileList @ThomasMichon
**/api-extractor.json @microsoft/fluentui-react-build
**/api-extractor.unstable.json @microsoft/fluentui-react-build
**/.swcrc @microsoft/fluentui-react-build
**/project.json @microsoft/fluentui-react-build
6 changes: 3 additions & 3 deletions .github/workflows/check-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: 14.18.1
node-version: 16.18.1
cache: 'yarn'

- uses: tj-actions/changed-files@v34
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: 14.18.1
node-version: 16.18.1

- uses: actions/github-script@v6
with:
Expand All @@ -70,7 +70,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: 14.18.1
node-version: 16.18.1

- uses: actions/github-script@v6
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docsite-publish-chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: 14.18.1
node-version: 16.18.1
cache: 'yarn'

- name: Install packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docsite-publish-ghpages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: 14.18.1
node-version: 16.18.1
cache: 'yarn'

- name: Install packages
Expand Down
198 changes: 198 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
name: PR CI

on:
pull_request:
branches:
- master

jobs:
prepare_env:
name: Prepare environment
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16.18.1'

- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}

- name: Cache Cypress Binary
id: cache-cypress-binary
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cypress-binary-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-cypress-binary-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-cypress-binary-

- name: Install packages
if: steps.cache-node-modules.outputs.cache-hit != 'true' || steps.cache-cypress-binary.outputs.cache-hit != 'true'
run: yarn install --prefer-offline --frozen-lockfile --non-interactive

- name: List the state of node modules
run: yarn list

- name: List node modules bin
continue-on-error: true
run: |
pwd
ls -la ~/.cache/
find . -name "node_modules" -prune

build_test_lint:
needs: [prepare_env]
name: Build, Test, Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16.18.1'

- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}

- name: List node modules bin
run: |
pwd
find . -name "node_modules" -prune

- name: Install packages
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --prefer-offline --frozen-lockfile --non-interactive

- name: Build, Test, Lint
run: yarn nx run-many --targets=build,test,lint,type-check --parallel=8

build:
needs: [prepare_env]
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16.18.1'

- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}

- name: List node modules bin
run: |
pwd
find . -name "node_modules" -prune

- name: Install packages
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --prefer-offline --frozen-lockfile --non-interactive

- name: Build
run: yarn nx run-many --targets=build --parallel=8

e2e:
needs: [prepare_env]
name: E2E target
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16.18.1'

- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}

- name: Cache Cypress Binary
id: cache-cypress-binary
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cypress-binary-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-cypress-binary-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-cypress-binary-

- name: Install packages
if: steps.cache-node-modules.outputs.cache-hit != 'true' || steps.cache-cypress-binary.outputs.cache-hit != 'true'
run: yarn install --prefer-offline --frozen-lockfile --non-interactive

- name: E2E
run: yarn nx run-many --targets=e2e

deploy:
needs: [prepare_env]
name: Deploy PR web
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16.18.1'

- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}

- name: Install packages
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --prefer-offline --frozen-lockfile --non-interactive

- name: Build storybook
run: yarn nx run-many --targets=build-storybook --parallel=8

- name: Bundle
run: yarn nx run-many --targets=bundle --parallel=8

# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version-file: 'package.json'
# cache: 'yarn'
# cache-dependency-path: '**/yarn.lock'
# - name: install dependencies
# run: yarn install --frozen-lockfile
# - name: NX run-many
# run: yarn nx run-many --targets=build,test,lint,type-check --parallel=8

# - name: Upload npm package
# uses: actions/upload-artifact@v3
# with:
# name: npm-package
# path: abc
4 changes: 3 additions & 1 deletion .nxignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Northstar files that doesn't belong to actual project to make nx workspace-lint pass
# Northstar files that doesn't belong to actual project to make nx workspace-lint pass

packages/fluentui/add-a-feature.md
packages/fluentui/document-a-feature.md
packages/fluentui/test-a-feature.md
Expand All @@ -8,3 +9,4 @@ packages/fluentui/CONTRIBUTING.md
packages/fluentui/README.md
packages/fluentui/lerna.json
packages/fluentui/package.json
**/dist/**
6 changes: 6 additions & 0 deletions apps/perf-test-react-components/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@fluentui/perf-test-react-components",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"implicitDependencies": []
}
6 changes: 6 additions & 0 deletions apps/perf-test/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@fluentui/perf-test",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"implicitDependencies": []
}
6 changes: 6 additions & 0 deletions apps/pr-deploy-site/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@fluentui/pr-deploy-site",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"implicitDependencies": []
}
6 changes: 6 additions & 0 deletions apps/public-docsite-resources/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@fluentui/public-docsite-resources",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"implicitDependencies": []
}
2 changes: 1 addition & 1 deletion apps/public-docsite-v9/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "Fluent UI React v9 documentation",
"scripts": {
"build": "just-scripts build",
"build-storybook": "build-storybook -o ./dist/storybook --docs && node ./.storybook/fix-title.js 'Fluent UI React v9' ../dist",
"build-storybook": "build-storybook --no-manager-cache -o ./dist/storybook --docs && node ./.storybook/fix-title.js 'Fluent UI React v9' ../dist",
"chromatic:branch": "npx [email protected] --project-token $CHROMATIC_PROJECT_TOKEN --exit-zero-on-changes --build-script-name build-storybook",
"chromatic": "npx [email protected] --project-token $CHROMATIC_PROJECT_TOKEN --exit-zero-on-changes --build-script-name build-storybook --branch-name microsoft:master",
"clean": "just-scripts clean",
Expand Down
7 changes: 7 additions & 0 deletions apps/public-docsite-v9/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "@fluentui/public-docsite-v9",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"implicitDependencies": [],
"tags": ["platform:web"]
}
6 changes: 6 additions & 0 deletions apps/public-docsite/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@fluentui/public-docsite",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"implicitDependencies": []
}
26 changes: 26 additions & 0 deletions apps/react-18-tests-v8/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
import * as path from 'path';
import { baseConfig } from '@fluentui/scripts-cypress';
import { TsconfigPathsPlugin } from 'tsconfig-paths-webpack-plugin';

registerTsPaths({
configFile: path.resolve(__dirname, '../../tsconfig.base.v8.json'),
config: baseConfig.component.devServer.webpackConfig,
});

export default baseConfig;

// TODO copied from scripts/storybook/utils - make it generic helper (out of SB domain)
function registerTsPaths(options: { configFile: string; config: import('webpack').Configuration }) {
// eslint-disable-next-line @typescript-eslint/no-shadow
const { config, configFile } = options;
const tsPaths = new TsconfigPathsPlugin({
configFile,
});

config.resolve = config.resolve ?? {};
config.resolve.plugins = config.resolve.plugins ?? [];

// remove existing to prevent multiple tspaths plugin
config.resolve.plugins = config.resolve.plugins.filter(plugin => !(plugin instanceof TsconfigPathsPlugin));

config.resolve.plugins.push(tsPaths);

return config;
}
3 changes: 2 additions & 1 deletion apps/react-18-tests-v8/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ if (config.globals) {
// override ts-jest config, otherwise it gets merged
config.globals['ts-jest'] = {
tsconfig: '<rootDir>/tsconfig.spec.json',
diagnostics: { warnOnly: true /* , exclude: ['packages/**'] */ },
// diagnostics: { warnOnly: true /* , exclude: ['packages/**'] */ },
isolatedModules: true,
};
}

Expand Down
2 changes: 1 addition & 1 deletion apps/react-18-tests-v8/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "8.0.0",
"private": true,
"scripts": {
"type-check": "tsc -p tsconfig.react-compat-check.json",
"type-check": "just-scripts type-check",
"format": "prettier -w . --ignore-path ../.prettierignore",
"format:check": "yarn format -c",
"e2e": "cypress run --component",
Expand Down
6 changes: 6 additions & 0 deletions apps/react-18-tests-v8/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@fluentui/react-18-tests-v8",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"implicitDependencies": []
}
Loading