2023-08-15 06:21:51 +00:00
|
|
|
name: Lint JS packages
|
2022-03-28 07:23:57 +00:00
|
|
|
|
2023-01-12 01:09:36 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- '**/changelog/**'
|
2022-09-07 00:04:18 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
2022-03-28 07:23:57 +00:00
|
|
|
|
2023-01-02 17:28:11 +00:00
|
|
|
permissions: {}
|
|
|
|
|
2022-03-28 07:23:57 +00:00
|
|
|
jobs:
|
2022-09-07 00:04:18 +00:00
|
|
|
lint-test-js:
|
2023-08-15 06:21:51 +00:00
|
|
|
name: Lint
|
2022-09-07 00:04:18 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2023-01-02 17:28:11 +00:00
|
|
|
permissions:
|
2023-01-12 01:09:36 +00:00
|
|
|
contents: read
|
2023-08-15 06:21:51 +00:00
|
|
|
# This is required to allow the action to annotate the PR with the linting results.
|
|
|
|
checks: write
|
|
|
|
pull-requests: read
|
2022-09-07 00:04:18 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
2023-08-16 11:02:32 +00:00
|
|
|
- name: Setup PNPM
|
|
|
|
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd
|
|
|
|
with:
|
|
|
|
version: '8.6.7'
|
|
|
|
|
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
|
|
|
|
with:
|
|
|
|
node-version-file: .nvmrc
|
|
|
|
cache: pnpm
|
|
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
|
|
|
|
- name: Install prerequisites
|
|
|
|
run: |
|
|
|
|
# ignore scripts is faster, and postinstall should not be needed for lint.
|
|
|
|
pnpm install --ignore-scripts
|
2022-09-07 00:04:18 +00:00
|
|
|
|
2022-10-12 02:05:01 +00:00
|
|
|
- name: Lint
|
2023-06-28 11:45:46 +00:00
|
|
|
run: pnpm run -r --filter='release-posts' --filter='woocommerce/client/admin...' --filter='@woocommerce/monorepo-utils' --filter='!@woocommerce/e2e*' --filter='!@woocommerce/api' --color lint
|
2023-08-15 06:21:51 +00:00
|
|
|
continue-on-error: true
|
2022-10-12 02:05:01 +00:00
|
|
|
|
2023-08-15 06:21:51 +00:00
|
|
|
- name: Collect and Combine Eslint Reports
|
|
|
|
run: node ./.github/workflows/scripts/collect-eslint-reports.js
|
|
|
|
|
|
|
|
- name: Annotate Code Linting Results
|
|
|
|
uses: ataylorme/eslint-annotate-action@a1bf7cb320a18aa53cb848a267ce9b7417221526
|
|
|
|
|
|
|
|
with:
|
|
|
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
|
|
|
report-json: 'combined_eslint_report.json'
|