Skip to content

Commit cd76516

Browse files
committed
ci: pcov try again
1 parent 2a12583 commit cd76516

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

.env.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@ TEST_ADMIN_USERNAME=admin
1414
TEST_ADMIN_PASSWORD=password
1515
TEST_ADMIN_PATH=/wp-admin
1616

17+
# Whether to install PCOV in the tests CLI.
18+
# PCOV_ENABLED=1
19+
20+
# Used to install the premium GF Addons in the CLI script.
1721
# GF_KEY=

.github/workflows/test.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ jobs:
167167
restore-keys: |
168168
${{ runner.os }}-wp-plugins-
169169
170-
- name: Setup WordPress
170+
- name: Setup .env file
171171
run: |
172172
cp .env.dist .env
173173
echo GF_KEY=${{ secrets.GF_KEY }} >> .env
@@ -274,7 +274,7 @@ jobs:
274274
restore-keys: |
275275
${{ runner.os }}-wp-plugins-
276276
277-
- name: Setup WordPress
277+
- name: Setup .env file
278278
run: |
279279
cp .env.dist .env
280280
echo GF_KEY=${{ secrets.GF_KEY }} >> .env
@@ -414,7 +414,7 @@ jobs:
414414
restore-keys: |
415415
${{ runner.os }}-wp-plugins-
416416
417-
- name: Setup WordPress
417+
- name: Setup Setup .env file
418418
run: |
419419
cp .env.dist .env
420420
echo GF_KEY=${{ secrets.GF_KEY }} >> .env
@@ -425,12 +425,8 @@ jobs:
425425
timeout_minutes: 10
426426
max_attempts: 3
427427
command: |
428-
# Set the COVERAGE env var if coverage is enabled
429-
if [ "${{ matrix.coverage }}" -eq "1" ]; then
430-
echo "COVERAGE=1" >> $GITHUB_ENV
431-
fi
428+
${{ matrix.coverage ? 'PCOV_ENABLED=1' : '' }} npm run wp-env start -- ${{ secrets.ACTIONS_STEP_DEBUG && '--debug' || '' }}
432429
433-
npm run wp-env start -- ${{ secrets.ACTIONS_STEP_DEBUG && '--debug' || '' }}
434430
435431
- name: Log versions
436432
run: |

.github/workflows/upload-schema-artifact.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
restore-keys: |
5555
${{ runner.os }}-wp-env-
5656
57-
- name: Setup WordPress
57+
- name: Setup .env file
5858
run: |
5959
cp .env.dist .env
6060
echo GF_KEY=${{ secrets.GF_KEY }} >> .env

bin/after-start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if [[ -n "$CONTAINER_ID" ]]; then
3636
install_pdo_mysql "$CONTAINER_ID" "tests-cli"
3737
fi
3838

39-
if [[ "$COVERAGE" == "1" ]]; then
39+
if [[ "$PCOV_ENABLED" == "1" ]]; then
4040
echo "Installing and enabling pcov extension for code coverage."
4141
npm run wp-env run tests-cli -- sudo pecl install pcov
4242

0 commit comments

Comments
 (0)