name: Lint and tests for JS packages and woocommerce-admin/client on: pull_request: paths: - 'packages/js/**/**' - 'plugins/woocommerce-admin/client/**' - '!**.md' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: lint-test-js: name: Lint and Test JS runs-on: ubuntu-20.04 steps: - name: Check out repository code uses: actions/checkout@v3 - uses: actions/setup-node@v2 with: node-version: '16' - name: Cache modules uses: actions/cache@v3 with: path: | ~/.pnpm-store key: ${{ runner.os }}-npm-version-${{ secrets.WORKFLOW_CACHE }}-${{ hashFiles('**/pnpm-lock.yaml') }} - name: Install PNPM run: npm install -g pnpm@^6.24.2 - name: Install dependencies run: pnpm install - name: Lint run: | pnpm nx build woocommerce-admin pnpm nx lint woocommerce-admin pnpm nx lint:js-packages woocommerce-admin - name: Test run: | pnpm nx build woocommerce-admin pnpm nx test woocommerce-admin pnpm nx test:packages woocommerce-admin