[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
uses: actions/setup-node@v3
with:
node-version: 14
node-version-file: '.nvmrc'
cache-dependency-path: package-lock.json
- name: get latest tag sha
id: tag-sha
@@ -56,6 +56,3 @@ runs:
uses: ./.github/actions/before-install
with:
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
uses: actions/setup-node@v3
with:
node-version: 14
node-version-file: '.nvmrc'
cache-dependency-path: package-lock.json
- name: Trigger Alpha ADF child build
shell: bash

View File

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

View File

@@ -96,11 +96,11 @@ jobs:
- name: Check package-lock.json version
run: |
if [[ $(jq '.lockfileVersion == 2' package-lock.json) == "true" ]] ; then
echo -e "\033[31mpackage-lock must be version 1\033[0m"
exit 1
if [[ $(jq '.lockfileVersion == 3' package-lock.json) == "true" ]] ; then
echo "package-lock.json has a correct version"
else
echo -e "\033[32mpackage-lock.json has a correct version\033[0m"
echo "package-lock must be version 3"
exit 1
fi
check-if-pr-is-approved:
@@ -197,9 +197,9 @@ jobs:
- name: install
run: |
npm ci
nx run cli:bundle
nx run testing:bundle
- run: nx print-affected $NX_CALCULATION_FLAGS
npx nx run cli:bundle
npx nx run testing:bundle
- run: npx nx print-affected $NX_CALCULATION_FLAGS
- uses: ./.github/actions/upload-node-modules-and-artifacts
unit-tests:
@@ -231,7 +231,7 @@ jobs:
- uses: ./.github/actions/download-node-modules-and-artifacts
- name: Run unit tests
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:
# 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
- uses: ./.github/actions/setup
- 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:
# 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
- uses: ./.github/actions/setup
- uses: ./.github/actions/download-node-modules-and-artifacts
- run: nx affected:build $NX_CALCULATION_FLAGS --prod
- run: nx build demoshell --configuration production
- run: nx affected --target=build-storybook $NX_CALCULATION_FLAGS --configuration ci
- run: npx nx affected:build $NX_CALCULATION_FLAGS --prod
- run: npx nx build demoshell --configuration production
- run: npx nx affected --target=build-storybook $NX_CALCULATION_FLAGS --configuration=ci --parallel=1
- uses: ./.github/actions/upload-node-modules-and-artifacts
e2e-storybook:

View File

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

View File

@@ -38,7 +38,7 @@ jobs:
const tagVersion = process.env.TAG_VERSION;
console.log('tagVersion:',tagVersion);
const getLatestVersionOf = require('./scripts/github/update/latest-version-of.js');
const { hasVersionNew: hasVersionNewJS, latestVersion: latestVersionJS } = await getLatestVersionOf({github, context, dependencyName: 'js-api', tagVersion});
console.log('hasVersionNewJS', hasVersionNewJS)
console.log('latestVersionJS', latestVersionJS)
@@ -99,7 +99,7 @@ jobs:
- name: setup NPM
uses: actions/setup-node@v3
with:
node-version: 14.15.4
node-version-file: '.nvmrc'
cache-dependency-path: package-lock.json
- name: "General :: dbpci-install"
run: |