From 1345e67f32b7e847850bb0d041a183682ba9a873 Mon Sep 17 00:00:00 2001 From: Grigory Date: Thu, 13 Jun 2024 18:33:44 +0500 Subject: [PATCH] refactor(workflows/ci): better workaround for installing yarn on node 16 --- .github/workflows/ci.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 736c2e3..7f6fe38 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,20 +21,15 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Setup target Node.js to enable Corepack + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - name: Enable Corepack - if: matrix.node != '16' run: corepack enable - - name: Fix yarn install on Node 16 - if: matrix.node == '16' - run: | - corepack disable - yarn_version=$(node -p "require('./package.json').packageManager.match(/\w+@([\d.]+)/)[1]") - npm pkg delete packageManager - npm install -g yarn --force - yarn set version $yarn_version - - - name: Setup Node.js ${{ matrix.node }} + - name: Setup Node.js ${{ matrix.node }} with cache uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }}