|
22 | 22 | DOLIBARR_LOG: documents/dolibarr.log |
23 | 23 | PHPSERVER_LOG: phpserver.log |
24 | 24 | PHPSERVER_DOMAIN_PORT: 127.0.0.1:8000 # could be 127.0.0.1:8000 if config modified |
| 25 | + DOLIPORT: 8000 |
| 26 | + DOLIHOST: 127.0.0.1 |
| 27 | + DOLIUSERNAME: admin |
| 28 | + DOLIPASSWORD: admin |
| 29 | + COOKIEJAR: "C:\\TEMP\\hurl_cookie${{ github.run_id }}.jar" |
| 30 | + RUN_HURL_TESTS: ${{ github.event_name == 'workflow_dispatch' || github.repository != 'Dolibarr/dolibarr' }} |
25 | 31 | CACHE_KEY_PART: ${{ ( inputs.gh_event == 'pull_request' || github.event_name == 'pull_request' ) && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }} |
26 | 32 | PHP_INI_SCAN_DIR: C:\myphpini |
27 | 33 | CKEY: win-ci-2 |
|
38 | 44 | steps: |
39 | 45 | - name: Checkout code |
40 | 46 | uses: actions/checkout@v5 |
| 47 | + |
41 | 48 | - name: Setup PHP |
42 | 49 | uses: shivammathur/setup-php@v2 |
43 | 50 | with: |
|
82 | 89 | # mariadb-version: ${{ matrix.mariadb-version }} |
83 | 90 | database: travis # Specify your database name |
84 | 91 |
|
| 92 | + - uses: gacts/install-hurl@v1 |
| 93 | + if: ${{ env.RUN_HURL_TESTS == 'true' }} |
| 94 | + #with: |
| 95 | + # disable-cache: true # disable cache usage |
| 96 | + # version: 1.2.0 # `latest` by default, but you can set a specific version to install |
| 97 | + |
85 | 98 | - name: Create local php.ini with open_basedir restrictions |
86 | 99 | shell: cmd |
87 | 100 | # Objective: separate step, and before database initialisation to verify open_basedir restrictions |
@@ -113,6 +126,8 @@ jobs: |
113 | 126 | php -r "$d=__DIR__.'\documents/mytest';echo 'TEST PATH IS SHOWN: '.$d.PHP_EOL;" |
114 | 127 | php -r "$d=__DIR__.'\documents/mytest';echo 'IS_DIR '.$d.' '.((int) is_dir($d)).PHP_EOL;" |
115 | 128 | ECHO "The above should show 2 successful tests" |
| 129 | + REM SETTING FOR HURL |
| 130 | +
|
116 | 131 |
|
117 | 132 | - name: Run Bash script that Initialises the database |
118 | 133 | # Note this is bash (MSYS) on Windows |
@@ -153,21 +168,25 @@ jobs: |
153 | 168 | cat htdocs/conf/conf.php |
154 | 169 | ECHO "#[endgroup]" |
155 | 170 | ECHO "==== START PHP server" |
156 | | - start /B php -S %PHPSERVER_DOMAIN_PORT% -t htdocs >> %PHPSERVER_LOG% 2>&1 |
| 171 | + start /B php -S %PHPSERVER_DOMAIN_PORT% -t htdocs > %PHPSERVER_LOG% 2>&1 |
157 | 172 | ECHO "#[group]==== Output from curl on PHP server" |
158 | 173 | curl "http://${{ env.PHPSERVER_DOMAIN_PORT }}" |
159 | 174 | ECHO "#[endgroup]" |
160 | 175 | ECHO "==== START PHPUNIT TESTS" |
161 | 176 | REM 'DOSKEY' USED to recover error code (no pipefile equivalent in windows?) |
162 | 177 | ( php "%PHPROOT%\phpunit" -d memory_limit=-1 -c %CD%\test\phpunit\phpunittest.xml "test\phpunit\AllTests.php" --exclude-group WindowsWaitingForFix & call doskey /exename=err err=%%^^errorlevel%% ) | "${{ env.TEE }}" "${{ env.PHPUNIT_LOG }}" |
| 178 | + IF "${{ env.RUN_HURL_TESTS }}" == "true" ( |
| 179 | + ECHO "==== START HURL TESTS (${{ env.COOKIEJAR }})" |
| 180 | + "C:\Program Files\Git\bin\bash.EXE" --noprofile --norc -e -o pipefail -c " export DOLIPORT='${{ env.DOLIPORT }}' ; export DOLIHOST='${{ env.DOLIHOST }}' ; export DOLIUSERNAME='${{ env.DOLIUSERNAME }}' ; export DOLIPASSWORD='${{ env.DOLIPASSWORD }}' ; export COOKIEJAR='${{ env.COOKIEJAR }}' ; test/hurl/run.sh" 2>&1 | "${{ env.TEE }}" -a "${{ env.PHPUNIT_LOG }}" |
| 181 | + ) |
163 | 182 | echo "" |
164 | 183 | echo "Ensure that PHPUNIT completed (no early exit from code)" |
165 | 184 | "${{ env.TAIL }}" -5 "${{ env.PHPUNIT_LOG }}" | "${{ env.GREP }}" -qE "(OK .*[0-9]+ tests.*[0-9]+ assertions|Tests: [0-9]+)" || EXIT /B 1 |
166 | 185 | echo "PHPUNIT seems to have completed with a test result, reuse the exit code" |
167 | 186 | for /f "tokens=2 delims==" %%A in ('doskey /m:err') do EXIT /B %%A |
168 | 187 |
|
169 | 188 | - name: Convert Raw Log to Annotations |
170 | | - uses: mdeweerd/logToCheckStyle@v2025.1.1 |
| 189 | + uses: mdeweerd/logToCheckStyle@v2025.11.2 |
171 | 190 | if: ${{ failure() }} |
172 | 191 | with: |
173 | 192 | in: ${{ env.PHPUNIT_LOG }} |
|
0 commit comments