From 3888d9bf844113674a702796647e0604632182a5 Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Tue, 11 Apr 2023 22:36:01 +0300 Subject: [PATCH] ci: update --- .github/workflows/test.yml | 8 ++++++-- azure-pipelines.yml | 28 ++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 827ee6b801c..b5b48548d15 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,8 +59,9 @@ jobs: with: node-version: 10.x cache: "yarn" + # Remove `devDependencies` from `package.json` to avoid `yarn install` compatibility error - run: node -e "const content = require('./package.json');delete content.devDependencies;require('fs').writeFileSync('package.json', JSON.stringify(content, null, 2));" - - run: yarn install --production --frozen-lockfile + - run: yarn install --frozen-lockfile unit: runs-on: ubuntu-latest steps: @@ -112,10 +113,13 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: "yarn" + # Install old `jest` version and ignore platform problem for legacy node versions - run: yarn upgrade jest@^27.5.0 jest-circus@^27.5.0 jest-cli@^27.5.0 jest-diff@^27.5.0 jest-environment-node@^27.5.0 jest-junit@^13.0.0 if: matrix.node-version == '10.x' || matrix.node-version == '12.x' - - run: yarn --frozen-lockfile + - run: yarn --frozen-lockfile --ignore-engines if: matrix.node-version == '10.x' || matrix.node-version == '12.x' + - run: yarn --frozen-lockfile + if: matrix.node-version != '10.x' && matrix.node-version != '12.x' - run: yarn link --frozen-lockfile || true - run: yarn link webpack --frozen-lockfile - uses: actions/cache@v3 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 926d86af356..a8ff1749bce 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -27,7 +27,7 @@ jobs: - script: | set -e export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" - yarn --frozen-lockfile --ignore-engines + yarn --frozen-lockfile yarn link --frozen-lockfile || true yarn link webpack --frozen-lockfile displayName: "Install dependencies" @@ -79,7 +79,7 @@ jobs: - script: | set -e export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" - yarn --frozen-lockfile --ignore-engines + yarn --frozen-lockfile yarn link --frozen-lockfile || true yarn link webpack --frozen-lockfile displayName: "Install dependencies" @@ -141,11 +141,16 @@ jobs: key: yarn | $(Agent.OS) | yarn.lock path: $(YARN_CACHE_FOLDER) displayName: "Cache Yarn packages" + # Install old `jest` version and ignore platform problem for legacy node versions - script: yarn upgrade jest@^27.5.0 jest-circus@^27.5.0 jest-cli@^27.5.0 jest-diff@^27.5.0 jest-environment-node@^27.5.0 jest-junit@^13.0.0 displayName: "Install old jest version" condition: or(eq(variables['node_version'], '^10.13.0'), eq(variables['node_version'], '^12.4.0')) + - script: yarn --frozen-lockfile --ignore-engines + displayName: "Install dependencies (old node.js version)" + condition: or(eq(variables['node_version'], '^10.13.0'), eq(variables['node_version'], '^12.4.0')) - script: yarn --frozen-lockfile displayName: "Install dependencies" + condition: and(not(eq(variables['node_version'], '^10.13.0')), not(eq(variables['node_version'], '^12.4.0'))) - script: yarn link --frozen-lockfile || true displayName: "Link webpack" continueOnError: true @@ -210,6 +215,7 @@ jobs: key: yarn | $(Agent.OS) | yarn.lock path: $(YARN_CACHE_FOLDER) displayName: "Cache Yarn packages" + # Install old `jest` version and ignore platform problem for legacy node versions - script: yarn upgrade jest@^27.5.0 jest-circus@^27.5.0 jest-cli@^27.5.0 jest-diff@^27.5.0 jest-environment-node@^27.5.0 jest-junit@^13.0.0 displayName: "Install old jest version" condition: or(eq(variables['node_version'], '^10.13.0'), eq(variables['node_version'], '^12.4.0')) @@ -219,7 +225,16 @@ jobs: yarn --frozen-lockfile --ignore-engines yarn link --frozen-lockfile || true yarn link webpack --frozen-lockfile + displayName: "Install dependencies (old node.js version)" + condition: or(eq(variables['node_version'], '^10.13.0'), eq(variables['node_version'], '^12.4.0')) + - script: | + set -e + export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" + yarn --frozen-lockfile + yarn link --frozen-lockfile || true + yarn link webpack --frozen-lockfile displayName: "Install dependencies" + condition: and(not(eq(variables['node_version'], '^10.13.0')), not(eq(variables['node_version'], '^12.4.0'))) - script: | set -e export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" @@ -284,7 +299,16 @@ jobs: yarn --frozen-lockfile --ignore-engines yarn link --frozen-lockfile || true yarn link webpack --frozen-lockfile + displayName: "Install dependencies (old node.js version)" + condition: or(eq(variables['node_version'], '^10.13.0'), eq(variables['node_version'], '^12.4.0')) + - script: | + set -e + export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" + yarn --frozen-lockfile + yarn link --frozen-lockfile || true + yarn link webpack --frozen-lockfile displayName: "Install dependencies" + condition: and(not(eq(variables['node_version'], '^10.13.0')), not(eq(variables['node_version'], '^12.4.0'))) - script: | set -e export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"