Skip to content

Commit

Permalink
Merge pull request #298 from shym/ci-32bit-opam
Browse files Browse the repository at this point in the history
CI 32-bit and OPAM
  • Loading branch information
jmid authored Feb 11, 2023
2 parents c2f6e18 + 0c89a67 commit 650c23e
Show file tree
Hide file tree
Showing 11 changed files with 120 additions and 12 deletions.
9 changes: 7 additions & 2 deletions .github/bin/sudo
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

# Dummy `sudo`, to skip some useless installations
if [ "$1" = "apt-get" -a "$2" = "install" ]; then
echo "Dummy sudo: installing only 'bubblewrap' only instead of running: $@"
/usr/bin/sudo apt-get install bubblewrap
if [ -n "$OVERRIDE_APT_INSTALL" ]; then
echo "Dummy sudo: installing only $OVERRIDE_APT_INSTALL instead of running: $@"
/usr/bin/sudo apt-get install $OVERRIDE_APT_INSTALL
else
echo "Dummy sudo: installing only bubblewrap instead of running: $@"
/usr/bin/sudo apt-get install bubblewrap
fi
else
echo Dummy: sudo "$@"
fi
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ on:
Defaults to custom_compiler_version chunked at [+~-]
type: string
default: ''
override_apt_install:
description: |
List of APT packages to install on Ubuntu runners instead of the default list used by `setup-ocaml`
type: string
default: 'bubblewrap'

jobs:
build-and-test:
Expand All @@ -87,6 +92,7 @@ jobs:
CUSTOM_COMPILER_VERSION: ${{ inputs.custom_compiler_version }}
CUSTOM_COMPILER_SRC: ${{ inputs.custom_compiler_src }}
CUSTOM_OCAML_PKG_VERSION: ${{ inputs.custom_ocaml_package_version }}
OVERRIDE_APT_INSTALL: ${{ inputs.override_apt_install }}

# For the record, here is how to set up the environment to test
# a PR-version of the compiler
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/linux-500-32bit-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 32bit 5.0.0

on: [push, pull_request, workflow_dispatch]

jobs:
build:
uses: ./.github/workflows/common.yml
with:
compiler: 'ocaml-variants.5.0.0+options,ocaml-option-32bit'
timeout: 360
override_apt_install: bubblewrap gcc-multilib g++-multilib
12 changes: 12 additions & 0 deletions .github/workflows/linux-510-32bit-trunk-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 32bit trunk

on: [push, pull_request, workflow_dispatch]

jobs:
build:
uses: ./.github/workflows/common.yml
with:
compiler: 'ocaml-variants.5.1.0+trunk,ocaml-option-32bit'
compiler_git_ref: refs/heads/trunk
timeout: 360
override_apt_install: bubblewrap gcc-multilib g++-multilib
38 changes: 38 additions & 0 deletions .github/workflows/opam.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: OPAM installation test

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

on:
schedule:
# Every Monday morning, at 1:11 UTC
- cron: '11 1 * * 1'

jobs:
build-and-test:
env:
QCHECK_MSG_INTERVAL: '60'

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install OCaml compiler
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 5.0.0
opam-depext: false

- name: Test installation of the OPAM packages
run: |
opam install --with-test ./qcheck-multicoretests-util.opam ./qcheck-lin.opam ./qcheck-stm.opam
- name: Show configuration
run: |
opam exec -- ocamlc -config
opam config list
opam exec -- dune printenv
opam list --columns=name,installed-version,repository,synopsis-or-target
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
Multicore tests
===============

[![Linux 5.0.0](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-500-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-500-workflow.yml) [![MacOSX 5.0.0](https://github.com/ocaml-multicore/multicoretests/actions/workflows/macosx-500-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/macosx-500-workflow.yml) [![Linux 5.0.0-bytecode](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-500-bytecode-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-500-bytecode-workflow.yml) [![Linux 5.0.0-debug](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-500-debug-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-500-debug-workflow.yml) [![Windows 5.0.0](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-500-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-500-workflow.yml) [![Windows 5.0.0-bytecode](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-500-bytecode-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-500-bytecode-workflow.yml)

[![Linux 5.1.0+trunk](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-510-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-510-trunk-workflow.yml) [![MacOSX 5.1.0+trunk](https://github.com/ocaml-multicore/multicoretests/actions/workflows/macosx-510-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/macosx-510-trunk-workflow.yml) [![Linux 5.1.0+trunk-bytecode](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-510-bytecode-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-510-bytecode-trunk-workflow.yml) [![Linux 5.1.0+trunk-debug](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-510-debug-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-510-debug-trunk-workflow.yml) [![Windows 5.1.0+trunk](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-510-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-510-trunk-workflow.yml) [![Windows 5.1.0+trunk-bytecode](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-510-trunk-bytecode-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-510-trunk-bytecode-workflow.yml)
[![Linux 5.0.0](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-500-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-500-workflow.yml)
[![MacOSX 5.0.0](https://github.com/ocaml-multicore/multicoretests/actions/workflows/macosx-500-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/macosx-500-workflow.yml)
[![Linux 5.0.0-bytecode](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-500-bytecode-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-500-bytecode-workflow.yml)
[![Linux 5.0.0-debug](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-500-debug-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-500-debug-workflow.yml)
[![Linux 32-bit 5.0.0](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-500-32bit-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-500-32bit-workflow.yml)
[![Windows 5.0.0](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-500-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-500-workflow.yml)
[![Windows 5.0.0-bytecode](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-500-bytecode-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-500-bytecode-workflow.yml)

[![Linux 5.1.0+trunk](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-510-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-510-trunk-workflow.yml)
[![MacOSX 5.1.0+trunk](https://github.com/ocaml-multicore/multicoretests/actions/workflows/macosx-510-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/macosx-510-trunk-workflow.yml)
[![Linux 5.1.0+trunk-bytecode](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-510-bytecode-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-510-bytecode-trunk-workflow.yml)
[![Linux 5.1.0+trunk-debug](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-510-debug-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-510-debug-trunk-workflow.yml)
[![Linux 32-bit 5.1.0+trunk](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-510-32bit-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-510-32bit-trunk-workflow.yml)
[![Windows 5.1.0+trunk](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-510-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-510-trunk-workflow.yml)
[![Windows 5.1.0+trunk-bytecode](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-510-trunk-bytecode-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-510-trunk-bytecode-workflow.yml)

Experimental property-based tests of (parts of) the OCaml multicore compiler.

Expand Down
8 changes: 6 additions & 2 deletions src/domain/domain_joingraph.ml
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,12 @@ let test_atomic_work ~domain_bound =
(*Printf.printf "main domain %i -- joining %s success\n%!" (Domain.self () :> int) tgt_id*)
) ps;
Atomic.get a = test_input.num_domains)

let bound_tak = if Sys.word_size == 64 then 100 else 8
let bound_atomic = if Sys.word_size == 64 then 250 else 8

;;
QCheck_base_runner.run_tests_main
[test_tak_work ~domain_bound:100(*8*);
test_atomic_work ~domain_bound:250(*8*)
[test_tak_work ~domain_bound:bound_tak;
test_atomic_work ~domain_bound:bound_atomic
]
8 changes: 7 additions & 1 deletion src/domain/domain_spawntree.ml
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,11 @@ let t ~max_height ~max_degree = Test.make
then true
else (Printf.printf "Failure \"%s\"\n%!" s; false)
))

let test =
if Sys.word_size == 64
then t ~max_height:5 ~max_degree:10
else t ~max_height:3 ~max_degree:3

;;
QCheck_base_runner.run_tests_main [t ~max_height:5 ~max_degree:10]
QCheck_base_runner.run_tests_main [test]
8 changes: 7 additions & 1 deletion src/thread/thread_createtree.ml
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,11 @@ let t ~max_height ~max_degree = Test.make
let a = Atomic.make 0 in
let () = thread_interp a c in
Atomic.get a = interp 0 c)

let test =
if Sys.word_size == 64
then t ~max_height:5 ~max_degree:10
else t ~max_height:3 ~max_degree:3

;;
QCheck_base_runner.run_tests_main [t ~max_height:5 ~max_degree:10]
QCheck_base_runner.run_tests_main [test]
8 changes: 6 additions & 2 deletions src/thread/thread_joingraph.ml
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,12 @@ let test_atomic_work ~thread_bound =
Thread.join p;
) ps;
Atomic.get a = test_input.num_threads)

let bound_tak = if Sys.word_size == 64 then 100 else 16
let bound_atomic = if Sys.word_size == 64 then 250 else 16

;;
QCheck_base_runner.run_tests_main
[test_tak_work ~thread_bound:100(*8*);
test_atomic_work ~thread_bound:250(*8*)
[test_tak_work ~thread_bound:bound_tak;
test_atomic_work ~thread_bound:bound_atomic
]
6 changes: 5 additions & 1 deletion src/threadomain/threadomain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,14 @@ let run_all_nodes sj =
Array.for_all (fun h -> h = NoHdl) hdls.handles
&& Atomic.get global = sz

let nb_nodes =
let max = if Sys.word_size == 64 then 100 else 16 in
Gen.int_range 2 max

let main_test = Test.make ~name:"Mash up of threads and domains"
~count:500
~print:show_spawn_join
(Gen.sized_size (Gen.int_range 2 100) gen_spawn_join)
(Gen.sized_size nb_nodes gen_spawn_join)
run_all_nodes
(* to debug deadlocks: *)
(* (Util.fork_prop_with_timeout 1 run_all_nodes) *)
Expand Down

0 comments on commit 650c23e

Please sign in to comment.