Skip to content

use predictable_mode for Cram tests #646

use predictable_mode for Cram tests

use predictable_mode for Cram tests #646

Workflow file for this run

name: Geneweb CI
on:
workflow_dispatch:
pull_request:
branches:
- master
paths-ignore:
- 'etc/**'
- 'hd/**'
- 'man/**'
- '**/*.md'
- 'geneweb_colab.ipynb'
- 'ICHANGES'
- 'INSTALL'
- 'LICENSE'
- 'CHANGES'
- '.gitattributes'
- '.gitignore'
- '.git-blame-ignore-revs'
- '.ocamlformat'
- '.ocamlformat-ignore'
- 'geneweb.iss'
- 'geneweb.opam.template'
push:
branches:
- master
paths-ignore:
- 'etc/**'
- 'hd/**'
- 'man/**'
- '**/*.md'
- 'geneweb_colab.ipynb'
- 'ICHANGES'
- 'INSTALL'
- 'LICENSE'
- 'CHANGES'
- '.gitattributes'
- '.gitignore'
- '.git-blame-ignore-revs'
- '.ocamlformat'
- '.ocamlformat-ignore'
- 'geneweb.iss'
- 'geneweb.opam.template'
env:
DUNE_PROFILE: "dev"
OPAMYES: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-26, windows-2022]
ocaml-compiler: [4.10.2, 4.14.2, 5.4.0]
exclude:
- os: windows-2022
ocaml-compiler: 4.10.2
outputs:
total_matrix_jobs: ${{ strategy.job-total || 0 }}
metric: ${{ steps.collect-metrics.outputs.metric }}
env:
USE_NNP: ${{ !startsWith(matrix.os, 'windows') && (matrix.ocaml-compiler == '4.14.2' || startsWith(matrix.ocaml-compiler, '5')) }}
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Start Build Timer
uses: ./.github/actions/ci-utils
with:
command: start-timer
- name: Cache Opam dependencies
id: cache-opam
uses: actions/cache@v5
with:
path: ${{ runner.os == 'Windows' && 'C:\\.opam' || '~/.opam' }}
key: ${{ runner.os }}-opam-${{ matrix.ocaml-compiler }}-${{ hashFiles('**/*.opam') }}
restore-keys: ${{ runner.os }}-opam-${{ matrix.ocaml-compiler }}-
- name: Setup Ocaml with v3
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: true
- name: Install Perl dependencies (Windows @v3)
if: runner.os == 'Windows'
run: cpan -j .github/ci-config/cpan-config.pm -T -f -i String::ShellQuote IPC::System::Simple;
shell: bash
- name: Remove locked mingw gcc shim if present
if: runner.os == 'Windows'
shell: bash
run: |
rm -f _opam/bin/x86_64-w64-mingw32-gcc.exe || true
rm -f _opam/bin/i686-w64-mingw32-gcc.exe || true
# The uucp library seems to push old OCaml compiler to their limits,
# see https://github.com/ocaml/ocaml/issues/14166. This is a workaround
# to avoid this error by increasing the stack limit of the current shell.
# The stack overflow occurred only with OCaml 4.10.2 on macOS.
- name: Install Geneweb dependencies
run: |
ulimit -Ss $(ulimit -Hs)
opam install . --deps-only --with-test
- name: Install ancient dependency
if: env.USE_NNP == 'true'
run: opam install ancient
- name: Configure
run: opam exec -- ocaml ./configure.ml --sosa-zarith ${{ env.USE_NNP == 'true' && '--gwd-caching' || '' }}
- name: Build Geneweb
id: build
shell: bash
run: opam exec -- make distrib distrib-rpc
- name: Run tests
id: tests
shell: bash
run: |
opam exec -- make ci 2>&1 | tee build-output.log
set +e
PASSED=$(grep -c "\[OK\]" build-output.log)
FAILED=$(grep -c "\[FAIL\]" build-output.log)
SKIPPED=$(grep -c "\[SKIP\]" build-output.log)
set -e
TOTAL=$((PASSED + FAILED + SKIPPED))
echo "tests_passed=$PASSED" >> $GITHUB_OUTPUT
echo "tests_failed=$FAILED" >> $GITHUB_OUTPUT
echo "tests_skipped=$SKIPPED" >> $GITHUB_OUTPUT
echo "tests_total=$TOTAL" >> $GITHUB_OUTPUT
- name: "Test Geneweb daemon with --cache-in-memory"
if: env.USE_NNP == 'true'
run: |
output=$(distribution/gw/gwd -cache-in-memory testing 2>&1)
if echo "$output" | grep -q "Caching database testing in memory"; then
echo "Caching message found, test passed."
exit 0
else
echo "Caching message not found, test failed."
exit 1
fi
- name: Collect Build Metrics
id: collect-metrics
uses: ./.github/actions/ci-utils
with:
command: collect-metrics
os: ${{ matrix.os }}
ocaml-version: ${{ matrix.ocaml-compiler }}
cache-hit: ${{ steps.cache-opam.outputs.cache-hit }}
tests-total: ${{ steps.tests.outputs.tests_total }}
tests-passed: ${{ steps.tests.outputs.tests_passed }}
tests-failed: ${{ steps.tests.outputs.tests_failed }}
tests-skipped: ${{ steps.tests.outputs.tests_skipped }}
build-results:
needs: [build]
runs-on: ubuntu-latest
if: always()
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Generate Build Summary
uses: ./.github/actions/ci-utils
with:
command: generate-summary
total-builds: ${{ needs.build.outputs.total_matrix_jobs }}