|
28 | 28 | description: 'OCAMLRUNPARAM to use'
|
29 | 29 | type: string
|
30 | 30 | default: ''
|
31 |
| - only_test: |
32 |
| - description: 'Only test to run (eg “src/array/lin_tests.exe”); whole suite is run if empty' |
| 31 | + dune_alias: |
| 32 | + description: 'dune alias that should be built in the main step' |
33 | 33 | type: string
|
34 |
| - default: '' |
35 |
| - seed: |
36 |
| - description: 'Seed for the only test' |
37 |
| - type: string |
38 |
| - default: '' |
39 |
| - repeats: |
40 |
| - description: 'Number of test attempts' |
41 |
| - type: string |
42 |
| - default: '10' |
43 |
| - repeats_failfast: |
44 |
| - description: 'When repeating a test, stop as soon as one test fails' |
45 |
| - type: boolean |
46 |
| - default: false |
47 |
| - subsuite: |
48 |
| - description: 'Directories which should be taken as part of the test suite' |
49 |
| - type: string |
50 |
| - default: 'src' |
| 34 | + default: 'runtest' |
51 | 35 | compiler:
|
52 | 36 | description: 'Compiler to use'
|
53 | 37 | type: string
|
|
83 | 67 | outputs:
|
84 | 68 | skippart2:
|
85 | 69 | description: 'Whether Part 2 (Cygwin workflow) should be skipped (because we are running only one test)'
|
86 |
| - value: ${{ jobs.test.outputs.skippart2 }} |
| 70 | + value: ${{ jobs.test.outputs.skipnextjob }} |
87 | 71 |
|
88 | 72 | jobs:
|
89 | 73 | test:
|
90 | 74 | env:
|
91 | 75 | QCHECK_MSG_INTERVAL: '60'
|
92 | 76 | DUNE_PROFILE: ${{ inputs.dune_profile }}
|
93 | 77 | OCAMLRUNPARAM: ${{ inputs.runparam }}
|
94 |
| - ONLY_TEST: ${{ inputs.only_test }} |
95 |
| - SEED: ${{ inputs.seed }} |
96 |
| - REPEATS: ${{ inputs.repeats }} |
97 |
| - REPEATS_FAILFAST: ${{ inputs.repeats_failfast }} |
98 |
| - SUBSUITE: ${{ inputs.subsuite }} |
| 78 | + DUNE_CI_ALIAS: ${{ inputs.dune_alias }} |
99 | 79 | COMPILER: ${{ inputs.compiler }}
|
100 | 80 | OCAML_COMPILER_GIT_REF: ${{ inputs.compiler_git_ref }}
|
101 | 81 | CUSTOM_COMPILER_VERSION: ${{ inputs.custom_compiler_version }}
|
|
113 | 93 | timeout-minutes: ${{ inputs.timeout }}
|
114 | 94 |
|
115 | 95 | outputs:
|
116 |
| - skippart2: ${{ steps.winonlyone.outputs.skippart2 }} |
| 96 | + skipnextjob: ${{ steps.mainstep.outputs.skipnextjob }} |
117 | 97 |
|
118 | 98 | steps:
|
119 | 99 | - name: Configure environment (Cygwin)
|
@@ -298,66 +278,10 @@ jobs:
|
298 | 278 |
|
299 | 279 | - name: Build the test suite
|
300 | 280 | run: opam exec -- dune build
|
301 |
| - if: env.ONLY_TEST == '' |
302 | 281 |
|
303 | 282 | - name: Run the internal package tests
|
304 | 283 | run: opam exec -- dune runtest -j1 --no-buffer --display=quiet --cache=disabled --error-reporting=twice test/
|
305 |
| - if: env.ONLY_TEST == '' |
306 | 284 |
|
307 |
| - - name: Run the multicore test suite (Linux / macOS) |
308 |
| - run: opam exec -- dune runtest -j1 --no-buffer --display=quiet --cache=disabled --error-reporting=twice $SUBSUITE |
309 |
| - if: "runner.os != 'Windows' && env.ONLY_TEST == ''" |
310 |
| - |
311 |
| - - name: Run the multicore test suite (Windows / Cygwin) |
312 |
| - run: opam exec -- dune runtest -j1 --no-buffer --display=quiet --cache=disabled --error-reporting=twice @(-Split $Env:SUBSUITE) |
313 |
| - if: "runner.os == 'Windows' && env.ONLY_TEST == ''" |
314 |
| - |
315 |
| - - name: Run only one test (Linux / macOS) |
316 |
| - run: | |
317 |
| - failures=0 |
318 |
| - for i in `seq "$REPEATS"`; do |
319 |
| - echo |
320 |
| - echo "Starting $i-th run" |
321 |
| - if [ -n "$SEED" ]; then |
322 |
| - if ! opam exec -- dune exec "$ONLY_TEST" -- -v -s "$SEED"; then |
323 |
| - if [ "$REPEATS_FAILFAST" = "true" ]; then |
324 |
| - exit 1 |
325 |
| - else |
326 |
| - failures=$((failures + 1)) |
327 |
| - fi |
328 |
| - fi |
329 |
| - else |
330 |
| - if ! opam exec -- dune exec "$ONLY_TEST" -- -v; then |
331 |
| - if [ "$REPEATS_FAILFAST" = "true" ]; then |
332 |
| - exit 1 |
333 |
| - else |
334 |
| - failures=$((failures + 1)) |
335 |
| - fi |
336 |
| - fi |
337 |
| - fi |
338 |
| - done |
339 |
| - echo "Test failed $failures times" |
340 |
| - [ "$failures" = 0 ] |
341 |
| - if: env.ONLY_TEST != '' && runner.os != 'Windows' |
342 |
| - |
343 |
| - - name: Run only one test (Windows) |
344 |
| - id: winonlyone |
345 |
| - run: | |
346 |
| - echo "skippart2=true" >> "${env:GITHUB_OUTPUT}" |
347 |
| - if("${env:REPEATS_FAILFAST}" -eq "false") { |
348 |
| - $ErrorActionPreference = 'Continue' |
349 |
| - } |
350 |
| - $failures = 0 |
351 |
| - for($i = 1; $i -le "${env:REPEATS}"; $i++) { |
352 |
| - echo "" |
353 |
| - echo "Starting $i-th run" |
354 |
| - if("${env:SEED}" -eq "") { |
355 |
| - opam exec -- dune exec "${env:ONLY_TEST}" -- -v |
356 |
| - if($? -eq 0) { $failures += 1 } |
357 |
| - } else { |
358 |
| - opam exec -- dune exec "${env:ONLY_TEST}" -- -v -s "${env:SEED}" |
359 |
| - if($? -eq 0) { $failures += 1 } |
360 |
| - } |
361 |
| - } |
362 |
| - echo "Test failed $failures times" |
363 |
| - if: env.ONLY_TEST != '' && runner.os == 'Windows' |
| 285 | + - name: Run the multicore test suite |
| 286 | + id: mainstep |
| 287 | + run: opam exec -- dune build "@ci" -j1 --no-buffer --display=quiet --cache=disabled --error-reporting=twice |
0 commit comments