From e916bcab75ffc3c7efa869b9b5243a3533bd1cfa Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Tue, 12 Nov 2024 12:06:03 +0000 Subject: [PATCH] ci: update of files from global .github repo --- .github/workflows/if-nodejs-pr-testing.yml | 47 ++++++++++++---------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/.github/workflows/if-nodejs-pr-testing.yml b/.github/workflows/if-nodejs-pr-testing.yml index ad7b99359..462e61316 100644 --- a/.github/workflows/if-nodejs-pr-testing.yml +++ b/.github/workflows/if-nodejs-pr-testing.yml @@ -46,31 +46,36 @@ jobs: name: Checkout repository uses: actions/checkout@v4 - if: steps.should_run.outputs.shouldrun == 'true' + name: Check if Node.js project and has package.json + id: packagejson + run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT + shell: bash + - if: steps.packagejson.outputs.exists == 'true' + name: Check package-lock version + uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master + id: lockversion + - if: steps.packagejson.outputs.exists == 'true' name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 20 - - if: steps.should_run.outputs.shouldrun == 'true' - uses: pnpm/action-setup@v3 - with: - run_install: false - - if: steps.should_run.outputs.shouldrun == 'true' - name: Get pnpm store directory + node-version: "${{ steps.lockversion.outputs.version }}" + - if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest' + #npm cli 10 is buggy because of some cache issue + name: Install npm cli 8 shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - if: steps.should_run.outputs.shouldrun == 'true' - uses: actions/cache@v4 - name: Setup pnpm cache - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - if: steps.should_run.outputs.shouldrun == 'true' + run: npm install -g npm@8.19.4 + - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies shell: bash - run: pnpm install - - if: steps.should_run.outputs.shouldrun == 'true' + run: npm ci + - if: steps.packagejson.outputs.exists == 'true' name: Test - run: pnpm test + run: npm test --if-present + - if: steps.packagejson.outputs.exists == 'true' && matrix.os == 'ubuntu-latest' + #linting should run just one and not on all possible operating systems + name: Run linter + run: npm run lint --if-present + - if: steps.packagejson.outputs.exists == 'true' + name: Run release assets generation to make sure PR does not break it + shell: bash + run: npm run generate:assets --if-present