Skip to content

Commit 8450d02

Browse files
authored
Merge pull request #199 from shym/fix-ci-repeat
CI configuration for running a single test
2 parents b21b39b + 721b59a commit 8450d02

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

.github/workflows/common.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ on:
3030
repeats:
3131
description: 'Number of test attempts'
3232
type: string
33-
default: ''
33+
default: '10'
3434
compiler_commit:
3535
description: 'Version (commit) of the OCaml compiler to use'
3636
type: string
@@ -107,19 +107,16 @@ jobs:
107107
run: opam exec -- dune runtest -j1 --no-buffer --display=quiet --cache=disabled --error-reporting=twice
108108
if: inputs.only_test == ''
109109

110-
- name: Run the one test
111-
run: opam exec -- dune exec "$ONLY_TEST" -- -v
112-
if: inputs.only_test != '' && inputs.seed == '' && inputs.repeats == ''
113-
114-
- name: Run the one test with a fixed seed
115-
run: opam exec -- dune exec "$ONLY_TEST" -- -v -s "$SEED"
116-
if: inputs.only_test != '' && inputs.seed != '' && inputs.repeats == ''
117-
118-
- name: Repeat the one test with a fixed seed
110+
- name: Run only one test
119111
run: |
120112
failures=0
121-
for i in `seq "$REPEATS"; do
122-
opam exec -- dune exec "$ONLY_TEST" -- -v -s "$SEED" || failures=$((failures + 1))
113+
for i in `seq "$REPEATS"`; do
114+
if [ -n "$SEED" ]; then
115+
opam exec -- dune exec "$ONLY_TEST" -- -v -s "$SEED" || failures=$((failures + 1))
116+
else
117+
opam exec -- dune exec "$ONLY_TEST" -- -v || failures=$((failures + 1))
118+
fi
123119
done
124-
exit "$failures"
125-
if: inputs.only_test != '' && inputs.seed != '' && inputs.repeats != ''
120+
echo "Test failed $failures times"
121+
[ "$failures" = 0 ]
122+
if: inputs.only_test != ''

0 commit comments

Comments
 (0)