From e35fce8d4055c8e89fc6ba81301d7634c1c0f66c Mon Sep 17 00:00:00 2001 From: Ashish Padhy <100484401+Shurtu-gal@users.noreply.github.com> Date: Sun, 25 Feb 2024 01:00:27 +0530 Subject: [PATCH 1/2] chore: add lint workflow --- .github/workflows/lint-pr.yml | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/lint-pr.yml diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml new file mode 100644 index 000000000000..197ca9ecca5a --- /dev/null +++ b/.github/workflows/lint-pr.yml @@ -0,0 +1,44 @@ +name: Lint changes in PR + +on: + pull_request: + types: [opened, reopened, synchronize, ready_for_review] + +jobs: + lint-nodejs-pr: + name: Lint NodeJS PR - ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + steps: + - name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows + run: | + git config --global core.autocrlf false + git config --global core.eol lf + - name: Checkout repository + uses: actions/checkout@v3 + - 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 + - name: Check package-lock version + uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master + id: lockversion + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "${{ steps.lockversion.outputs.version }}" + cache: 'npm' + cache-dependency-path: '**/package-lock.json' + - name: Install dependencies + id: first-installation + run: npm install --loglevel verbose + continue-on-error: true + - if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true' + name: Clear NPM cache and install deps again + run: | + npm cache clean --force + npm install --loglevel verbose + - name: Run linter + run: npm run lint --if-present \ No newline at end of file From 66f967f65a03c51ca8ed159a02bbe505861369e8 Mon Sep 17 00:00:00 2001 From: Ashish Padhy <100484401+Shurtu-gal@users.noreply.github.com> Date: Tue, 27 Feb 2024 14:22:08 +0530 Subject: [PATCH 2/2] chore: change test command name --- .github/workflows/lint-pr.yml | 44 ----------------------------------- package.json | 2 +- 2 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 .github/workflows/lint-pr.yml diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml deleted file mode 100644 index 197ca9ecca5a..000000000000 --- a/.github/workflows/lint-pr.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Lint changes in PR - -on: - pull_request: - types: [opened, reopened, synchronize, ready_for_review] - -jobs: - lint-nodejs-pr: - name: Lint NodeJS PR - ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - steps: - - name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows - run: | - git config --global core.autocrlf false - git config --global core.eol lf - - name: Checkout repository - uses: actions/checkout@v3 - - 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 - - name: Check package-lock version - uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master - id: lockversion - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: "${{ steps.lockversion.outputs.version }}" - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - - name: Install dependencies - id: first-installation - run: npm install --loglevel verbose - continue-on-error: true - - if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true' - name: Clear NPM cache and install deps again - run: | - npm cache clean --force - npm install --loglevel verbose - - name: Run linter - run: npm run lint --if-present \ No newline at end of file diff --git a/package.json b/package.json index 22d41d9efa0a..b6d111ba59d6 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "generate:dashboard": "node scripts/dashboard/build-dashboard.js", "generate:videos": "node scripts/build-newsroom-videos.js", "generate:tools": "node scripts/build-tools.js", - "test": "npx cypress run --component", + "test:components": "npx cypress run --component", "cy:open": "cypress open", "cy:run": "cypress run" },