[ADF-5509] Migrate to Node 18 (#8531)

* generate lock file

* gha: use node 18

* upgrade lock file and remove old migrations cache

* use npx instead of sudo link for nx commands

* fix dependencies

* migrate commands to node 18

* fix dependencies

* try building storybook sequentially

* fix affected libs

* disable failing test
This commit is contained in:
Denys Vuika
2023-05-04 22:51:19 +01:00
committed by GitHub
parent 42a2a3cd1f
commit 94c23171db
14 changed files with 42275 additions and 31930 deletions

View File

@@ -22,7 +22,7 @@ runs:
- name: install NPM - name: install NPM
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 14 node-version-file: '.nvmrc'
cache-dependency-path: package-lock.json cache-dependency-path: package-lock.json
- name: get latest tag sha - name: get latest tag sha
id: tag-sha id: tag-sha
@@ -56,6 +56,3 @@ runs:
uses: ./.github/actions/before-install uses: ./.github/actions/before-install
with: with:
act: ${{ inputs.act }} act: ${{ inputs.act }}
- name: link nx executable
run: sudo ln -s $(npm bin)/nx /usr/bin/nx
shell: bash

View File

@@ -86,7 +86,7 @@ jobs:
- name: install NPM - name: install NPM
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 14 node-version-file: '.nvmrc'
cache-dependency-path: package-lock.json cache-dependency-path: package-lock.json
- name: Trigger Alpha ADF child build - name: Trigger Alpha ADF child build
shell: bash shell: bash

View File

@@ -103,7 +103,7 @@ jobs:
- name: install NPM - name: install NPM
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 14 node-version-file: '.nvmrc'
- name: "Release tag" - name: "Release tag"
run: | run: |
git fetch --all --quiet git fetch --all --quiet

View File

@@ -96,11 +96,11 @@ jobs:
- name: Check package-lock.json version - name: Check package-lock.json version
run: | run: |
if [[ $(jq '.lockfileVersion == 2' package-lock.json) == "true" ]] ; then if [[ $(jq '.lockfileVersion == 3' package-lock.json) == "true" ]] ; then
echo -e "\033[31mpackage-lock must be version 1\033[0m" echo "package-lock.json has a correct version"
exit 1
else else
echo -e "\033[32mpackage-lock.json has a correct version\033[0m" echo "package-lock must be version 3"
exit 1
fi fi
check-if-pr-is-approved: check-if-pr-is-approved:
@@ -197,9 +197,9 @@ jobs:
- name: install - name: install
run: | run: |
npm ci npm ci
nx run cli:bundle npx nx run cli:bundle
nx run testing:bundle npx nx run testing:bundle
- run: nx print-affected $NX_CALCULATION_FLAGS - run: npx nx print-affected $NX_CALCULATION_FLAGS
- uses: ./.github/actions/upload-node-modules-and-artifacts - uses: ./.github/actions/upload-node-modules-and-artifacts
unit-tests: unit-tests:
@@ -231,7 +231,7 @@ jobs:
- uses: ./.github/actions/download-node-modules-and-artifacts - uses: ./.github/actions/download-node-modules-and-artifacts
- name: Run unit tests - name: Run unit tests
run: | run: |
/usr/bin/xvfb-run --auto-servernum nx affected:test $NX_CALCULATION_FLAGS --exclude=${{ matrix.unit-tests.exclude }} /usr/bin/xvfb-run --auto-servernum npx nx affected:test $NX_CALCULATION_FLAGS --exclude=${{ matrix.unit-tests.exclude }}
lint: lint:
# long timeout required when cache has to be recreated # long timeout required when cache has to be recreated
@@ -246,7 +246,7 @@ jobs:
fetch-depth: 0 # Fetch all history for all tags and branches fetch-depth: 0 # Fetch all history for all tags and branches
- uses: ./.github/actions/setup - uses: ./.github/actions/setup
- uses: ./.github/actions/download-node-modules-and-artifacts - uses: ./.github/actions/download-node-modules-and-artifacts
- run: nx affected --target=lint $NX_CALCULATION_FLAGS - run: npx nx affected --target=lint $NX_CALCULATION_FLAGS
build-libs: build-libs:
# long timeout required when cache has to be recreated # long timeout required when cache has to be recreated
@@ -261,9 +261,9 @@ jobs:
fetch-depth: 0 # Fetch all history for all tags and branches fetch-depth: 0 # Fetch all history for all tags and branches
- uses: ./.github/actions/setup - uses: ./.github/actions/setup
- uses: ./.github/actions/download-node-modules-and-artifacts - uses: ./.github/actions/download-node-modules-and-artifacts
- run: nx affected:build $NX_CALCULATION_FLAGS --prod - run: npx nx affected:build $NX_CALCULATION_FLAGS --prod
- run: nx build demoshell --configuration production - run: npx nx build demoshell --configuration production
- run: nx affected --target=build-storybook $NX_CALCULATION_FLAGS --configuration ci - run: npx nx affected --target=build-storybook $NX_CALCULATION_FLAGS --configuration=ci --parallel=1
- uses: ./.github/actions/upload-node-modules-and-artifacts - uses: ./.github/actions/upload-node-modules-and-artifacts
e2e-storybook: e2e-storybook:

View File

@@ -97,8 +97,8 @@ jobs:
- name: install - name: install
run: | run: |
npm ci npm ci
nx run cli:bundle npx nx run cli:bundle
nx run testing:bundle npx nx run testing:bundle
- uses: ./.github/actions/upload-node-modules-and-artifacts - uses: ./.github/actions/upload-node-modules-and-artifacts
release-demoshell: release-demoshell:
@@ -123,7 +123,7 @@ jobs:
- uses: ./.github/actions/download-node-modules-and-artifacts - uses: ./.github/actions/download-node-modules-and-artifacts
- name: release Demoshell docker - name: release Demoshell docker
run: | run: |
nx build demoshell --configuration production npx nx build demoshell --configuration production
. ./scripts/github/release/docker-tag.sh . ./scripts/github/release/docker-tag.sh
./scripts/github/release/release-demoshell-docker.sh ${{ steps.set-dryrun.outputs.dryrun }} ./scripts/github/release/release-demoshell-docker.sh ${{ steps.set-dryrun.outputs.dryrun }}
@@ -150,7 +150,7 @@ jobs:
- uses: ./.github/actions/download-node-modules-and-artifacts - uses: ./.github/actions/download-node-modules-and-artifacts
- name: release Storybook docker - name: release Storybook docker
run: | run: |
nx run stories:build-storybook --configuration ci npx nx run stories:build-storybook --configuration ci
. ./scripts/github/release/docker-tag.sh . ./scripts/github/release/docker-tag.sh
./scripts/github/release/release-storybook-docker.sh ${{ steps.set-dryrun.outputs.dryrun }} ./scripts/github/release/release-storybook-docker.sh ${{ steps.set-dryrun.outputs.dryrun }}
@@ -191,24 +191,24 @@ jobs:
run: | run: |
set -u; set -u;
./scripts/github/build/bumpversion.sh ./scripts/github/build/bumpversion.sh
nx affected:build $NX_CALCULATION_FLAGS --prod --exclude="demoshell" --skip-nx-cache npx nx affected:build $NX_CALCULATION_FLAGS --prod --exclude="demoshell" --skip-nx-cache
nx affected $NX_CALCULATION_FLAGS --target=pretheme npx nx affected $NX_CALCULATION_FLAGS --target=pretheme
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
name: release libraries GH registry name: release libraries GH registry
with: with:
node-version: 14 node-version-file: '.nvmrc'
registry-url: 'https://npm.pkg.github.com' registry-url: 'https://npm.pkg.github.com'
scope: '@alfresco' scope: '@alfresco'
- run: nx affected --target=npm-publish $NX_CALCULATION_FLAGS --tag=$TAG_NPM || exit 1 - run: npx nx affected --target=npm-publish $NX_CALCULATION_FLAGS --tag=$TAG_NPM || exit 1
env: env:
NODE_AUTH_TOKEN: ${{ secrets.PAT_WRITE_PKG }} NODE_AUTH_TOKEN: ${{ secrets.PAT_WRITE_PKG }}
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
name: release libraries Npm registry name: release libraries Npm registry
with: with:
node-version: 14 node-version-file: '.nvmrc'
registry-url: 'https://${{ vars.NPM_REGISTRY_ADDRESS }}' registry-url: 'https://${{ vars.NPM_REGISTRY_ADDRESS }}'
scope: '@alfresco' scope: '@alfresco'
- run: nx affected --target=npm-publish $NX_CALCULATION_FLAGS --tag=$TAG_NPM || exit 1 - run: npx nx affected --target=npm-publish $NX_CALCULATION_FLAGS --tag=$TAG_NPM || exit 1
env: env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}

View File

@@ -99,7 +99,7 @@ jobs:
- name: setup NPM - name: setup NPM
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 14.15.4 node-version-file: '.nvmrc'
cache-dependency-path: package-lock.json cache-dependency-path: package-lock.json
- name: "General :: dbpci-install" - name: "General :: dbpci-install"
run: | run: |

2
.nvmrc
View File

@@ -1 +1 @@
14 18

0
NX
View File

View File

@@ -272,7 +272,7 @@
"options": { "options": {
"commands": [ "commands": [
{ {
"command": "$(npm bin)/cspell 'demo-shell/**/*.ts'" "command": "npx cspell 'demo-shell/**/*.ts'"
} }
] ]
} }
@@ -407,7 +407,7 @@
"options": { "options": {
"commands": [ "commands": [
{ {
"command": "$(npm bin)/cspell 'lib/core/**/*.ts'" "command": "npx cspell 'lib/core/**/*.ts'"
} }
] ]
} }
@@ -417,7 +417,7 @@
"options": { "options": {
"commands": [ "commands": [
{ {
"command": "$(npm bin)/stylelint lib/core/**/*.scss --config stylelint-config.json" "command": "npx stylelint lib/core/**/*.scss --config stylelint-config.json"
} }
] ]
} }
@@ -427,7 +427,7 @@
"options": { "options": {
"commands": [ "commands": [
{ {
"command": "$(npm bin)/license-checker --production --failOn 'GPL;GPL-2.0' > licenses.txt" "command": "npx license-checker --production --failOn 'GPL;GPL-2.0' > licenses.txt"
} }
] ]
} }
@@ -437,7 +437,7 @@
"options": { "options": {
"commands": [ "commands": [
{ {
"command": "$(npm bin)/webpack -- --config ./lib/config/webpack.style.js --progress --profile --bail" "command": "npx webpack -- --config ./lib/config/webpack.style.js --progress --profile --bail"
} }
] ]
} }
@@ -547,7 +547,7 @@
"options": { "options": {
"commands": [ "commands": [
{ {
"command": "$(npm bin)/cspell 'lib/content-services/**/*.ts'" "command": "npx cspell 'lib/content-services/**/*.ts'"
} }
] ]
} }
@@ -557,7 +557,7 @@
"options": { "options": {
"commands": [ "commands": [
{ {
"command": "$(npm bin)/stylelint lib/content-services/**/*.scss --config stylelint-config.json" "command": "npx stylelint lib/content-services/**/*.scss --config stylelint-config.json"
} }
] ]
} }
@@ -623,7 +623,7 @@
"options": { "options": {
"commands": [ "commands": [
{ {
"command": "$(npm bin)/cspell 'lib/process-services/**/*.ts'" "command": "npx cspell 'lib/process-services/**/*.ts'"
} }
] ]
}, },
@@ -632,7 +632,7 @@
"options": { "options": {
"commands": [ "commands": [
{ {
"command": "$(npm bin)/stylelint lib/process-services/**/*.scss --config stylelint-config.json" "command": "npx stylelint lib/process-services/**/*.scss --config stylelint-config.json"
} }
] ]
} }
@@ -643,7 +643,7 @@
"options": { "options": {
"commands": [ "commands": [
{ {
"command": "$(npm bin)/stylelint lib/process-services-cloud/**/*.scss --config stylelint-config.json" "command": "npx stylelint lib/process-services-cloud/**/*.scss --config stylelint-config.json"
} }
] ]
} }
@@ -754,7 +754,7 @@
"options": { "options": {
"commands": [ "commands": [
{ {
"command": "$(npm bin)/playwright test --config='e2e-playwright/playwright.config.ts'" "command": "npx playwright test --config='e2e-playwright/playwright.config.ts'"
} }
] ]
} }
@@ -764,7 +764,7 @@
"options": { "options": {
"commands": [ "commands": [
{ {
"command": "$(npm bin)/cspell 'lib/process-services-cloud/**/*.ts'" "command": "npx cspell 'lib/process-services-cloud/**/*.ts'"
} }
] ]
} }
@@ -774,7 +774,7 @@
"options": { "options": {
"commands": [ "commands": [
{ {
"command": "$(npm bin)/stylelint lib/process-services-cloud/**/*.scss --config stylelint-config.json" "command": "npx stylelint lib/process-services-cloud/**/*.scss --config stylelint-config.json"
} }
] ]
} }
@@ -840,7 +840,7 @@
"options": { "options": {
"commands": [ "commands": [
{ {
"command": "$(npm bin)/cspell 'lib/insights/**/*.ts'" "command": "npx cspell 'lib/insights/**/*.ts'"
} }
] ]
} }
@@ -850,7 +850,7 @@
"options": { "options": {
"commands": [ "commands": [
{ {
"command": "$(npm bin)/stylelint lib/insights/**/*.scss --config stylelint-config.json" "command": "npx stylelint lib/insights/**/*.scss --config stylelint-config.json"
} }
] ]
} }
@@ -916,7 +916,7 @@
"options": { "options": {
"commands": [ "commands": [
{ {
"command": "$(npm bin)/cspell 'lib/extensions/**/*.ts'" "command": "npx cspell 'lib/extensions/**/*.ts'"
} }
] ]
} }

View File

@@ -12,5 +12,6 @@
"C216430": "https://alfresco.atlassian.net/browse/ACS-4595", "C216430": "https://alfresco.atlassian.net/browse/ACS-4595",
"C280063": "https://alfresco.atlassian.net/browse/ACS-4595", "C280063": "https://alfresco.atlassian.net/browse/ACS-4595",
"C280064": "https://alfresco.atlassian.net/browse/ACS-4595", "C280064": "https://alfresco.atlassian.net/browse/ACS-4595",
"C280407": "https://alfresco.atlassian.net/browse/ACS-4595" "C280407": "https://alfresco.atlassian.net/browse/ACS-4595",
"C277288": "https://alfresco.atlassian.net/browse/ADF-5540"
} }

View File

@@ -1,60 +0,0 @@
{
"migrations": [
{
"version": "12.5.0-beta.1",
"description": "Rename the workspace-schematic script into workspace-generator script",
"factory": "./src/migrations/update-12-5-0/add-target-dependencies",
"cli": "nx",
"package": "@nrwl/workspace",
"name": "add-target-dependencies"
},
{
"version": "13.0.0-beta.1",
"description": "Add default base to nx.json if its not currently set",
"factory": "./src/migrations/update-13-0-0/set-default-base-if-not-set",
"cli": "nx",
"package": "@nrwl/workspace",
"name": "set-default-base-if-not-set"
},
{
"version": "13.0.0-beta.4",
"description": "Move global settings into nx.json, and project specific settings into workspace.json",
"cli": "nx",
"implementation": "./src/migrations/update-13-0-0/config-locations/config-locations",
"package": "@nrwl/workspace",
"name": "13-0-0-config-locations"
},
{
"version": "13.2.0",
"description": "Set --parallel=1 for existing repos to preserve the existing behavior",
"cli": "nx",
"implementation": "./src/migrations/update-13-2-0/set-parallel-default",
"package": "@nrwl/workspace",
"name": "set-parallel-default"
},
{
"version": "13.3.0-beta.0",
"description": "@nrwl/workspace:tsc is now @nrwl/js:tsc",
"cli": "nx",
"implementation": "./src/migrations/update-13-3-0/update-tsc-executor-location",
"package": "@nrwl/workspace",
"name": "13-3-0-tsc-location"
},
{
"version": "13.6.0-beta.0",
"description": "Remove old options that are no longer used",
"cli": "nx",
"implementation": "./src/migrations/update-13-6-0/remove-old-task-runner-options",
"package": "@nrwl/workspace",
"name": "13-6-0-remove-old-task-runner-options"
},
{
"version": "13.4.6-beta.1",
"cli": "nx",
"description": "Add projectBuildConfig option to project's Storybook config.",
"factory": "./src/migrations/update-13-4-6/set-project-build-config",
"package": "@nrwl/storybook",
"name": "update-13.4.6"
}
]
}

74040
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -72,10 +72,10 @@
"@editorjs/header": "2.7.0", "@editorjs/header": "2.7.0",
"@editorjs/list": "1.8.0", "@editorjs/list": "1.8.0",
"@editorjs/underline": "1.1.0", "@editorjs/underline": "1.1.0",
"@mat-datetimepicker/core": "^9.0.68", "@mat-datetimepicker/core": "^10.1.1",
"@mat-datetimepicker/moment": "^9.0.68", "@mat-datetimepicker/moment": "^10.1.1",
"@ngx-translate/core": "^14.0.0", "@ngx-translate/core": "^14.0.0",
"@storybook/core-server": "6.4.22", "@storybook/core-server": "^6.5.16",
"angular-oauth2-oidc": "^13.0.1", "angular-oauth2-oidc": "^13.0.1",
"angular-oauth2-oidc-jwks": "^15.0.1", "angular-oauth2-oidc-jwks": "^15.0.1",
"apollo-angular": "^4.2.1", "apollo-angular": "^4.2.1",
@@ -129,6 +129,7 @@
"@typescript-eslint/eslint-plugin": "5.59.0", "@typescript-eslint/eslint-plugin": "5.59.0",
"@typescript-eslint/parser": "5.38.1", "@typescript-eslint/parser": "5.38.1",
"@typescript-eslint/typescript-estree": "5.55.0", "@typescript-eslint/typescript-estree": "5.55.0",
"ajv": "^8.12.0",
"commander": "6.2.1", "commander": "6.2.1",
"cspell": "^5.5.1", "cspell": "^5.5.1",
"css-loader": "^6.7.1", "css-loader": "^6.7.1",

View File

@@ -26,8 +26,8 @@ if [ ${AFFECTED_LIB} == true ]; then
if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then
echo "Calculate affected e2e $BASE_HASH $HEAD_HASH" echo "Calculate affected e2e $BASE_HASH $HEAD_HASH"
echo "nx affected:libs --base=$BASE_HASH --head=$HEAD_HASH --plain" echo "npx nx affected:libs --base=$BASE_HASH --head=$HEAD_HASH --plain"
AFFECTED_LIBS="$(nx affected:libs --base=$BASE_HASH --head=$HEAD_HASH --plain || exit 1)" AFFECTED_LIBS="$(npx nx affected:libs --base=$BASE_HASH --head=$HEAD_HASH --plain || exit 1)"
echo "Affected libs ${AFFECTED_LIBS}" echo "Affected libs ${AFFECTED_LIBS}"
AFFECTED_E2E="$(./scripts/git-util/affected-folder.sh -b $GITHUB_BASE_REF -f "e2e/$FOLDER")"; AFFECTED_E2E="$(./scripts/git-util/affected-folder.sh -b $GITHUB_BASE_REF -f "e2e/$FOLDER")";
echo "Affected e2e ${AFFECTED_E2E}" echo "Affected e2e ${AFFECTED_E2E}"