-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: upgrade to nx 19.1 and angular 18 (#209)
## PR Checklist Please check if your PR fulfills the following requirements: - [x] The commit message follows our guidelines: CONTRIBUTING.md#commit - [ ] Tests for the changes have been added (for bug fixes / features) - [x] Docs have been added / updated (for bug fixes / features) ## PR Type What kind of change does this PR introduce? <!-- Please check the one that applies to this PR using "x". --> ``` [ ] Bugfix [x] Feature [ ] Code style update (formatting, local variables) [ ] Refactoring (no functional changes, no api changes) [x] Build related changes [ ] CI related changes [x] Documentation content changes [ ] Other... Please describe: ``` ## What is the current behavior? We are supporting the previous version of Angular (17) ## What is the new behavior? - We support the latest version of Angular (18) - We have migrated to the latest version of Nx (19.1) ## Does this PR introduce a breaking change? ``` [x] Yes [ ] No ``` We increased the major version of the compatibility to Angular 18.
- Loading branch information
1 parent
5c8cb54
commit e6bd458
Showing
30 changed files
with
24,479 additions
and
18,059 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,10 @@ on: | |
- main | ||
pull_request: {} | ||
|
||
permissions: | ||
actions: read | ||
contents: read | ||
|
||
concurrency: | ||
# Group concurrency on workflow, then: | ||
# - Is merge run? Group on branch name (`refs/heads/main`) | ||
|
@@ -24,73 +28,80 @@ env: | |
NODE_OPTIONS: --max-old-space-size=6144 | ||
|
||
jobs: | ||
# We're using Nx Cloud for Distributed Task Execution | ||
# Reference: https://nx.dev/using-nx/dte | ||
# | ||
# The coordinator outputs the combination of task outputs from the agents, | ||
# both terminal and file outputs | ||
dte_coordinator: | ||
name: DTE Coordinator | ||
uses: nrwl/ci/.github/workflows/[email protected] | ||
secrets: | ||
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | ||
permissions: | ||
contents: read | ||
actions: read | ||
with: | ||
main-branch-name: main | ||
# Must match dte_agents.number-of-agents | ||
number-of-agents: 4 | ||
# The --stop-agents-after parameter must match the task target listed last | ||
# in the parallel-commands-on-agents command list | ||
# The --agent-count parameter must match the number-of-agents parameter | ||
init-commands: | | ||
yarn nx-cloud start-ci-run --stop-agents-after="e2e" --agent-count=4 | ||
# Commands run in parallel on this DTE coordinator | ||
parallel-commands: | | ||
yarn nx-cloud record -- yarn nx format:check | ||
# Commands distributed between DTE agents | ||
# Distribution strategy for 2 vCPUs per hosted runner (GitHub Free): | ||
# lint: 2 tasks assigned at a time, 1 task per vCPU | ||
# test: 1 task assigned at a time with 2 parallel processes, 1 process per vCPU | ||
# build: 2 tasks assigned at a time, 1 task per vCPU | ||
# e2e: 1 task assigned at a time, 1 task total | ||
parallel-commands-on-agents: | | ||
yarn nx run-many --all --target=lint --configuration=report --parallel=2 --max-warnings=0 | ||
yarn nx run-many --all --target=test --configuration=coverage --parallel=1 --max-workers=2 | ||
yarn nx affected --target=build --parallel=2 | ||
yarn nx affected --target=e2e --parallel=1 | ||
# Commands run sequentially on this DTE coordinator after parallel jobs | ||
# final-commands: | | ||
|
||
# We're using Nx Cloud for Distributed Task Execution | ||
# Reference: https://nx.dev/using-nx/dte | ||
# | ||
# Agents receive tasks to execute in bulk whenever they are ready or have | ||
# finished their previous tasks | ||
dte_agents: | ||
name: DTE Agents | ||
uses: nrwl/ci/.github/workflows/[email protected] | ||
secrets: | ||
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | ||
permissions: | ||
contents: read | ||
actions: read | ||
with: | ||
# The Free GitHub plan has a limit of 20 concurrent jobs on Ubuntu images | ||
# Reference: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration | ||
# If we need to, we can optimize for 2 simultaneous workflow runs: | ||
# 2 x 1 main job = 2 concurrent jobs | ||
# 2 x 9 agent jobs = 18 concurrent jobs | ||
# Total = 20 concurrent jobs | ||
# | ||
# However, we don't have many projects or targets in this workspace, so we | ||
# lower the number of agents to reduce spent compute time. | ||
number-of-agents: 4 | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Connect your workspace on nx.app and uncomment this to enable task distribution. | ||
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested | ||
# - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build" | ||
|
||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 9 | ||
# Cache node_modules | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- uses: nrwl/nx-set-shas@v4 | ||
|
||
# Restore the previous npm modules and Cypress binary archives. | ||
# Any updated archives will be saved automatically after the entire | ||
# workflow successfully finishes. | ||
# See https://github.com/actions/cache | ||
# we use exact restore key to avoid npm module snowballing | ||
# https://glebbahmutov.com/blog/do-not-let-npm-cache-snowball/ | ||
- name: Cache central npm modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ github.ref }}-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-node-${{ github.ref }}-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
# we use the exact restore key to avoid Cypress binary snowballing | ||
# https://glebbahmutov.com/blog/do-not-let-cypress-cache-snowball/ | ||
- name: Cache Cypress binary | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/Cypress | ||
key: cypress-${{ runner.os }}-cypress-${{ github.ref }}-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
cypress-${{ runner.os }}-cypress-${{ github.ref }}-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
# Cache local node_modules to pass to testing jobs | ||
- name: Cache local node_modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-modules-${{ github.ref }}-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-node-modules-${{ github.ref }}- | ||
- name: install dependencies and verify Cypress | ||
env: | ||
# make sure every Cypress install prints minimal information | ||
CI: 1 | ||
run: | | ||
pnpm install --frozen-lockfile | ||
pnpm exec cypress cache path | ||
pnpm exec cypress cache list | ||
pnpm exec cypress verify | ||
pnpm exec cypress info | ||
- name: Run NX Commands | ||
run: | | ||
pnpm exec nx-cloud record -- nx format:check | ||
pnpm exec nx affected -t lint test build | ||
pnpm exec nx affected -t e2e-ci --parallel=1 | ||
deploy-docs: | ||
name: '[Merge] Deploy docs to GitHub Pages' | ||
needs: dte_coordinator | ||
needs: main | ||
if: github.event_name == 'push' && github.ref_name == 'main' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
|
@@ -110,9 +121,9 @@ jobs: | |
uses: ./.github/actions/setup | ||
# Uses the cache generated in the distributed step | ||
- name: Build docs | ||
run: yarn nx build docs-lumberjack-docs-app | ||
run: pnpm exec nx build docs-lumberjack-docs-app | ||
- name: Set up GitHub Pages | ||
uses: actions/configure-pages@v4 | ||
uses: actions/nonfigure-pages@v4 | ||
- name: Upload docs to GitHub Pages | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
|
@@ -123,7 +134,7 @@ jobs: | |
|
||
sonarcloud: | ||
name: SonarCloud | ||
needs: dte_coordinator | ||
needs: main | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
|
@@ -138,13 +149,13 @@ jobs: | |
uses: ./.github/actions/setup | ||
# Uses the cache generated in the distributed step (Needed for the sonar eslint reports). | ||
- name: Lint with reports | ||
run: yarn nx run-many --all --target=lint --configuration=report --parallel=2 --max-warnings=0 | ||
run: pnpm exec nx run-many --all --target=lint --configuration=report --parallel=2 --max-warnings=0 | ||
# Uses the cache generated in the distributed step (Needed for the sonar jest coverage reports). | ||
- name: Tests with coverage | ||
run: yarn nx run-many --all --target=test --configuration=coverage --parallel=1 --max-workers=2 | ||
run: pnpm exec nx run-many --all --target=test --configuration=coverage --parallel=1 --max-workers=2 | ||
|
||
- name: Configure Sonar report paths | ||
run: yarn configure-sonar-report-paths | ||
run: pnpm run configure-sonar-report-paths | ||
|
||
- name: SonarCloud Scan | ||
uses: sonarsource/[email protected] | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,4 +48,6 @@ migrations.json | |
.docusaurus/ | ||
.cache-loader/ | ||
|
||
.nx/cache | ||
.nx/cache | ||
.nx/workspace-data | ||
.angular |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
18.19.0 | ||
20 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.