2022-03-28 07:23:57 +00:00
|
|
|
name: Lint and tests for JS packages and woocommerce-admin/client
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'packages/js/**/**'
|
|
|
|
- 'plugins/woocommerce-admin/client/**'
|
|
|
|
- '!**.md'
|
2022-04-21 16:45:12 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
2022-03-28 07:23:57 +00:00
|
|
|
|
|
|
|
jobs:
|
2022-03-28 08:59:43 +00:00
|
|
|
lint-test-js:
|
2022-03-29 02:05:12 +00:00
|
|
|
name: Lint and Test JS
|
2022-04-27 01:28:56 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2022-03-28 07:23:57 +00:00
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
2022-04-21 16:45:12 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-03-28 07:23:57 +00:00
|
|
|
|
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: '16'
|
|
|
|
|
2022-05-13 20:43:33 +00:00
|
|
|
- name: Dependency caching
|
2022-04-21 16:45:12 +00:00
|
|
|
uses: actions/cache@v3
|
2022-05-13 20:43:33 +00:00
|
|
|
id: cache-deps
|
2022-04-21 16:45:12 +00:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.pnpm-store
|
2022-05-16 13:01:53 +00:00
|
|
|
~/.local/share/pnpm/store
|
2022-05-13 20:43:33 +00:00
|
|
|
~/.cache/composer/files
|
|
|
|
key: ${{ runner.os }}-pr-lint-test-js-${{ secrets.WORKFLOW_CACHE }}-${{ hashFiles('**/composer.lock', '**/pnpm-lock.yaml') }}
|
2022-04-21 16:45:12 +00:00
|
|
|
|
|
|
|
- name: Install PNPM
|
2022-05-02 17:08:52 +00:00
|
|
|
run: npm install -g pnpm@^6.24.2
|
2022-04-21 16:45:12 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install
|
2022-03-28 07:23:57 +00:00
|
|
|
|
|
|
|
- name: Lint
|
|
|
|
run: |
|
2022-04-29 20:31:19 +00:00
|
|
|
pnpm nx build woocommerce-admin
|
2022-03-28 07:23:57 +00:00
|
|
|
pnpm nx lint woocommerce-admin
|
2022-03-29 02:08:30 +00:00
|
|
|
pnpm nx lint:js-packages woocommerce-admin
|
2022-03-28 07:23:57 +00:00
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: |
|
|
|
|
pnpm nx build woocommerce-admin
|
|
|
|
pnpm nx test woocommerce-admin
|
2022-03-28 08:59:43 +00:00
|
|
|
pnpm nx test:packages woocommerce-admin
|