@@ -57,99 +57,11 @@ jobs:
5757 - name : Checkout
5858 uses : actions/checkout@v4
5959
60- - name : Install PHP
61- uses : shivammathur/setup-php@v2
62- with :
63- php-version : ${{ matrix.php }}
64- extensions : json, mbstring
65- tools : composer:v2
66-
67- - name : Install Composer dependencies
68- uses : ramsey/composer-install@v3
60+ - name : Run Codeception Tests
61+ uses : ./codeception/action
6962 with :
7063 working-directory : plugins/${{ steps.plugin.outputs.slug }}
71- composer-options : " --no-progress"
72-
73- - name : Copy .env file
74- working-directory : plugins/${{ steps.plugin.outputs.slug }}
75- run : |
76- cp .docker/.env.ci .env
77- echo "INCLUDE_EXTENSIONS=${{ matrix.extensions }}" >> .env
78- echo "WP_VERSION=${{ matrix.wordpress }}" >> .env
79- echo "PHP_VERSION=${{ matrix.php }}" >> .env
80- env :
81- WP_VERSION : ${{ matrix.wordpress }}
82- PHP_VERSION : ${{ matrix.php }}
83- INCLUDE_EXTENSIONS : ${{ matrix.extensions }}
84-
85- - name : Build test environment
86- working-directory : plugins/${{ steps.plugin.outputs.slug }}
87- run : |
88- composer run docker:build
89- env :
90- WP_VERSION : ${{ matrix.wordpress }}
91- PHP_VERSION : ${{ matrix.php }}
92-
93- - name : Start test environment
94- working-directory : plugins/${{ steps.plugin.outputs.slug }}
95- run : |
96- docker compose --env-file .env up --detach
97-
98- CONTAINER_ID=$(docker compose ps -q wordpress)
99- if [ -n "$CONTAINER_ID" ]; then
100- docker exec $CONTAINER_ID init-docker.sh
101- else
102- echo "Error: WordPress container not found."
103- exit 1
104- fi
105- env :
106- WP_VERSION : ${{ matrix.wordpress }}
107- PHP_VERSION : ${{ matrix.php }}
108-
109- - name : Run Acceptance Tests w/ Docker
110- working-directory : plugins/${{ steps.plugin.outputs.slug }}
111- run : |
112- if [ "${{ matrix.extensions }}" = "true" ]; then
113- docker exec \
114- --env DEBUG=${{ env.DEBUG }} \
115- --env SKIP_TESTS_CLEANUP=${{ env.SKIP_TESTS_CLEANUP }} \
116- --env SUITES=${{ env.SUITES }} \
117- $(docker compose ps -q wordpress) \
118- bash -c "cd wp-content/plugins/${{ steps.plugin.outputs.slug }} && bin/run-codeception.sh"
119- fi
120- env :
121- DEBUG : ${{ secrets.ACTIONS_STEP_DEBUG || matrix.debug }}
122- SKIP_TESTS_CLEANUP : ' true'
123- SUITES : acceptance
124- continue-on-error : true
125-
126- - name : Run Functional Tests w/ Docker
127- working-directory : plugins/${{ steps.plugin.outputs.slug }}
128- run : |
129- docker exec \
130- --env DEBUG=${{ env.DEBUG }} \
131- --env SKIP_TESTS_CLEANUP=${{ env.SKIP_TESTS_CLEANUP }} \
132- --env SUITES=${{ env.SUITES }} \
133- $(docker compose ps -q wordpress) \
134- bash -c "cd wp-content/plugins/${{ steps.plugin.outputs.slug }} && bin/run-codeception.sh"
135- env :
136- DEBUG : ${{ secrets.ACTIONS_STEP_DEBUG || matrix.debug }}
137- SKIP_TESTS_CLEANUP : ' true'
138- SUITES : functional
139- continue-on-error : true
140-
141- - name : Run WPUnit Tests w/ Docker
142- working-directory : plugins/${{ steps.plugin.outputs.slug }}
143- run : |
144- docker exec \
145- --env COVERAGE=${{ env.COVERAGE }} \
146- --env USING_XDEBUG=${{ env.USING_XDEBUG }} \
147- --env DEBUG=${{ env.DEBUG }} \
148- --env SUITES=${{ env.SUITES }} \
149- $(docker compose ps -q wordpress) \
150- bash -c "cd wp-content/plugins/${{ steps.plugin.outputs.slug }} && bin/run-codeception.sh"
151- env :
152- COVERAGE : ${{ matrix.coverage }}
153- USING_XDEBUG : ${{ matrix.coverage }}
154- DEBUG : ${{ secrets.ACTIONS_STEP_DEBUG || matrix.debug }}
155- SUITES : wpunit
64+ php : ${{ matrix.php }}
65+ wordpress : ${{ matrix.wordpress }}
66+ extensions : ${{ matrix.extensions }}
67+ coverage : ${{ matrix.coverage }}
0 commit comments