Use Nx commands in pr-code-coverage action

This commit is contained in:
roykho 2021-11-16 07:26:33 -08:00
parent c91dda177d
commit 6f0bba9e23
No known key found for this signature in database
GPG Key ID: 7B36C0EA25795714
2 changed files with 23 additions and 3 deletions

View File

@ -45,15 +45,23 @@ jobs:
./vendor
key: ${{ runner.os }}-${{ hashFiles('./composer.lock') }}
- name: Install PNPM and install dependencies
run: |
npm install -g pnpm
pnpm install
- name: Install Nx
run: npm install -g nx
- name: Setup and install composer
run: composer install
run: pnpm nx composer-install woocommerce
- name: Init DB and WP
run: ./tests/bin/install.sh woo_test root root 127.0.0.1 latest
run: pnpm nx install-unit-test-db woocommerce
- name: Run unit tests with code coverage. Allow to fail.
run: |
RUN_CODE_COVERAGE=1 bash ./tests/bin/phpunit.sh
pnpm nx test-code-coverage woocommerce
exit 0
- name: Send code coverage to Codecov.

View File

@ -122,6 +122,18 @@
"options": {
"script": "make:collection"
}
},
"install-unit-test-db": {
"executor": "@nrwl/workspace:run-commands",
"options": {
"command": "bash ./tests/bin/install.sh woo_test root root 127.0.0.1 latest"
}
},
"test-code-coverage": {
"executor": "@nrwl/workspace:run-commands",
"options": {
"command": "RUN_CODE_COVERAGE=1 bash ./tests/bin/phpunit.sh"
}
}
}
}