Skip to content

Commit 9c387c0

Browse files
committed
Fixing action to get it working.
1 parent d2417aa commit 9c387c0

File tree

2 files changed

+6
-95
lines changed

2 files changed

+6
-95
lines changed
Lines changed: 5 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# codeception/action.yml
21
name: 'Run Codeception Tests'
32
description: 'Sets up environment and runs Codeception test suites'
43
inputs:
@@ -11,105 +10,18 @@ inputs:
1110
wordpress:
1211
description: 'WordPress version'
1312
required: true
14-
extensions:
15-
description: 'Extensions flag'
16-
required: false
17-
default: ''
18-
coverage:
19-
description: 'Enable coverage'
20-
required: false
21-
default: ''
2213
runs:
2314
using: "composite"
2415
steps:
25-
- name: Install PHP
16+
- name: Setup PHP
2617
uses: shivammathur/setup-php@v2
2718
with:
2819
php-version: ${{ inputs.php }}
29-
extensions: json, mbstring
3020
tools: composer:v2
21+
coverage: none
3122

32-
- name: Install Composer dependencies
33-
uses: ramsey/composer-install@v3
23+
- name: Install dependencies
24+
uses: ramsey/composer-install@v2
3425
with:
3526
working-directory: ${{ inputs.working-directory }}
36-
composer-options: "--no-progress"
37-
38-
- name: Copy .env file
39-
working-directory: ${{ inputs.working-directory }}
40-
run: |
41-
cp .docker/.env.ci .env
42-
echo "INCLUDE_EXTENSIONS=${{ inputs.extensions }}" >> .env
43-
echo "WP_VERSION=${{ inputs.wordpress }}" >> .env
44-
echo "PHP_VERSION=${{ inputs.php }}" >> .env
45-
env:
46-
WP_VERSION: ${{ inputs.wordpress }}
47-
PHP_VERSION: ${{ inputs.php }}
48-
INCLUDE_EXTENSIONS: ${{ inputs.extensions }}
49-
50-
- name: Build test environment
51-
working-directory: ${{ inputs.working-directory }}
52-
run: |
53-
composer run docker:build
54-
env:
55-
WP_VERSION: ${{ inputs.wordpress }}
56-
PHP_VERSION: ${{ inputs.php }}
57-
58-
- name: Start test environment
59-
working-directory: ${{ inputs.working-directory }}
60-
run: |
61-
docker compose --env-file .env up --detach
62-
63-
CONTAINER_ID=$(docker compose ps -q wordpress)
64-
if [ -n "$CONTAINER_ID" ]; then
65-
docker exec $CONTAINER_ID init-docker.sh
66-
else
67-
echo "Error: WordPress container not found."
68-
exit 1
69-
fi
70-
env:
71-
WP_VERSION: ${{ inputs.wordpress }}
72-
PHP_VERSION: ${{ inputs.php }}
73-
74-
- name: Run Acceptance Tests w/ Docker
75-
working-directory: ${{ inputs.working-directory }}
76-
run: |
77-
if [ "${{ inputs.extensions }}" = "true" ]; then
78-
docker exec \
79-
--env DEBUG=${{ env.DEBUG }} \
80-
--env SKIP_TESTS_CLEANUP=${{ env.SKIP_TESTS_CLEANUP }} \
81-
--env SUITES=acceptance \
82-
$(docker compose ps -q wordpress) \
83-
bash -c "cd wp-content/plugins/$(basename ${{ inputs.working-directory }}) && bin/run-codeception.sh"
84-
fi
85-
env:
86-
DEBUG: ${{ env.ACTIONS_STEP_DEBUG }}
87-
SKIP_TESTS_CLEANUP: 'true'
88-
continue-on-error: true
89-
90-
- name: Run Functional Tests w/ Docker
91-
working-directory: ${{ inputs.working-directory }}
92-
run: |
93-
docker exec \
94-
--env DEBUG=${{ env.DEBUG }} \
95-
--env SKIP_TESTS_CLEANUP=${{ env.SKIP_TESTS_CLEANUP }} \
96-
--env SUITES=functional \
97-
$(docker compose ps -q wordpress) \
98-
bash -c "cd wp-content/plugins/$(basename ${{ inputs.working-directory }}) && bin/run-codeception.sh"
99-
env:
100-
DEBUG: ${{ env.ACTIONS_STEP_DEBUG }}
101-
SKIP_TESTS_CLEANUP: 'true'
102-
continue-on-error: true
103-
104-
- name: Run WPUnit Tests w/ Docker
105-
working-directory: ${{ inputs.working-directory }}
106-
run: |
107-
docker exec \
108-
--env COVERAGE=${{ inputs.coverage }} \
109-
--env USING_XDEBUG=${{ inputs.coverage }} \
110-
--env DEBUG=${{ env.DEBUG }} \
111-
--env SUITES=wpunit \
112-
$(docker compose ps -q wordpress) \
113-
bash -c "cd wp-content/plugins/$(basename ${{ inputs.working-directory }}) && bin/run-codeception.sh"
114-
env:
115-
DEBUG: ${{ env.ACTIONS_STEP_DEBUG }}
27+
composer-options: "--no-progress"

.github/workflows/codeception.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,4 @@ jobs:
6363
working-directory: plugins/${{ steps.plugin.outputs.slug }}
6464
php: ${{ matrix.php }}
6565
wordpress: ${{ matrix.wordpress }}
66-
extensions: ${{ matrix.extensions }}
67-
coverage: ${{ matrix.coverage }}
66+
coverage: 1

0 commit comments

Comments
 (0)