Use Nx commands in pr-code-coverage action
This commit is contained in:
parent
c91dda177d
commit
6f0bba9e23
|
@ -45,15 +45,23 @@ jobs:
|
||||||
./vendor
|
./vendor
|
||||||
key: ${{ runner.os }}-${{ hashFiles('./composer.lock') }}
|
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
|
- name: Setup and install composer
|
||||||
run: composer install
|
run: pnpm nx composer-install woocommerce
|
||||||
|
|
||||||
- name: Init DB and WP
|
- 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.
|
- name: Run unit tests with code coverage. Allow to fail.
|
||||||
run: |
|
run: |
|
||||||
RUN_CODE_COVERAGE=1 bash ./tests/bin/phpunit.sh
|
pnpm nx test-code-coverage woocommerce
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
- name: Send code coverage to Codecov.
|
- name: Send code coverage to Codecov.
|
||||||
|
|
|
@ -122,6 +122,18 @@
|
||||||
"options": {
|
"options": {
|
||||||
"script": "make:collection"
|
"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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue