Skip to content

Commit

Permalink
ci: update pipelines to run properly after move to nx (microsoft#32172)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hotell authored Jul 31, 2024
1 parent 3da4204 commit a1ce4d2
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 4 deletions.
10 changes: 8 additions & 2 deletions .devops/templates/build-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ steps:
DANGER_GITHUB_API_TOKEN: $(DANGER_GITHUB_API_TOKEN)
- script: |
yarn buildci $(sinceArg)
displayName: build, test, lint, test-ssr
yarn nx affected -t build test lint type-check test-ssr test-integration verify-packaging --nxBail $(sinceArg)
displayName: build, test, lint, test-ssr (affected)
condition: eq(variables.isPR, true)
- script: |
yarn nx run-many -t build test lint type-check test-ssr test-integration verify-packaging --nxBail
displayName: build, test, lint, test-ssr (all)
condition: eq(variables.isPR, false)
- template: cleanup.yml
22 changes: 22 additions & 0 deletions .devops/templates/deployE2E.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,22 @@ steps:
- script: |
yarn nx affected -t bundle --nxBail $(sinceArg)
displayName: bundle
condition: eq(variables.isPR, true)
- script: |
yarn nx affected -t build-storybook --nxBail $(sinceArg)
displayName: build Storybooks
condition: eq(variables.isPR, true)
## This runs regardless of scope, the app will adapt to the scope as well
- script: |
yarn nx run pr-deploy-site:generate:site
displayName: generate PR Deploy Site
condition: eq(variables.isPR, true)
- task: AzureCLI@2
displayName: Upload PR deploy site
condition: eq(variables.isPR, true)
inputs:
azureSubscription: $(azureSubscription)
scriptType: 'bash'
Expand All @@ -45,6 +49,7 @@ steps:
- task: GithubPRStatus@0
displayName: 'Update PR deploy site github status'
condition: eq(variables.isPR, true)
inputs:
githubOwner: microsoft
githubRepo: fluentui
Expand All @@ -57,5 +62,22 @@ steps:
- script: |
NX_PARALLEL=1 yarn nx affected -t e2e --nxBail --parallel 1 $(sinceArg)
displayName: Cypress E2E tests
condition: eq(variables.isPR, true)
- script: |
yarn nx run-many -t bundle --nxBail
displayName: bundle
condition: eq(variables.isPR, false)
- script: |
yarn nx run-many -t build-storybook --nxBail
displayName: build Storybooks
condition: eq(variables.isPR, false)
# TODO: once https://github.com/nrwl/nx/issues/26903 will be fixed we can remove NX_PARALLEL=1 override via env variable
- script: |
NX_PARALLEL=1 yarn nx run-many -t e2e --nxBail --parallel 1
displayName: Cypress E2E tests
condition: eq(variables.isPR, false)
- template: cleanup.yml
2 changes: 1 addition & 1 deletion azure-pipelines-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ trigger: none
variables:
- ${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/heads/')) }}:
- name: sinceArg
value: --since $(targetBranch)
value: --base $(targetBranch)

- group: fabric-variables

Expand Down
6 changes: 6 additions & 0 deletions azure-pipelines.bundlesize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- script: |
yarn nx affected -t bundle-size --nxBail $(sinceArg)
displayName: build packages & create reports
condition: eq(variables.isPR, true)
- script: |
npx monosize compare-reports --branch=$(System.PullRequest.TargetBranch) --output=markdown --quiet > ./monosize-report.md
Expand All @@ -43,6 +44,11 @@ jobs:
status: 'success'
uniqueId: 'bundleSizeComment9423'

- script: |
yarn nx run-many -t bundle-size --nxBail
displayName: build all packages & create reports
condition: eq(variables.isPR, false)
- script: |
yarn monosize upload-report --branch=$(Build.SourceBranchName) --commit-sha $(Build.SourceVersion)
displayName: upload a report (base only)
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.vrt-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ trigger: none
variables:
- ${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/heads/')) }}:
- name: sinceArg
value: --since $(targetBranch)
value: --base $(targetBranch)

- template: .devops/templates/variables.yml

Expand Down

0 comments on commit a1ce4d2

Please sign in to comment.