diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..904e4cadf --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,71 @@ +name: main + +on: [push, pull_request] + +jobs: + no-naked-pointers: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: configure tree + run: ./configure --disable-naked-pointers --disable-stdlib-manpages + - name: Build + run: | + make -j world.opt + - name: Run the testsuite + run: | + make -C testsuite USE_RUNTIME=d all + i386-static: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Packages + run: | + sudo apt install gcc-multilib gfortran-multilib + - name: configure tree + run: | + XARCH=i386 CONFIG_ARG='--disable-stdlib-manpages --disable-shared' bash -xe tools/ci/actions/runner.sh configure + - name: Build + run: | + bash -xe tools/ci/actions/runner.sh build + - name: Run the testsuite + run: | + bash -xe tools/ci/actions/runner.sh test + - name: Install + run: | + bash -xe tools/ci/actions/runner.sh install + - name: Other checks + run: | + bash -xe tools/ci/actions/runner.sh other-checks + full-flambda: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Packages + run: | + sudo apt install texlive-latex-extra texlive-fonts-recommended + # Ensure that make distclean can be run from an empty tree + - name: distclean + run: | + MAKE_ARG=-j make distclean + - name: configure tree + run: | + MAKE_ARG=-j XARCH=x64 CONFIG_ARG='--enable-flambda --enable-dependency-generation' OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh configure + - name: Build + run: | + MAKE_ARG=-j OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh build + - name: Run the testsuite + run: | + MAKE_ARG=-j OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh test + - name: Build API Documentation + run: | + MAKE_ARG=-j OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh api-docs + - name: Install + run: | + MAKE_ARG=-j OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh install + - name: Other checks + run: | + MAKE_ARG=-j OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh other-checks diff --git a/.github/workflows/nnp.yml b/.github/workflows/nnp.yml deleted file mode 100644 index c5a505dc2..000000000 --- a/.github/workflows/nnp.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: main - -on: [push, pull_request] - -jobs: - no-naked-pointers: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: configure tree - run: ./configure --disable-naked-pointers --disable-stdlib-manpages - - name: Build - run: | - make -j world.opt - - name: Run the testsuite - run: | - make -C testsuite USE_RUNTIME=d all diff --git a/.travis.yml b/.travis.yml index 0e5145065..a2373e87e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,51 +20,10 @@ git: script: tools/ci/travis/travis-ci.sh matrix: include: - - env: >- - CI_KIND=build - XARCH=x64 - CONFIG_ARG=--enable-flambda - OCAMLRUNPARAM=b,v=0 - - env: >- - CI_KIND=build - XARCH=i386 - CONFIG_ARG=--disable-stdlib-manpages - addons: - apt: - packages: - - gcc-multilib - - env: >- - CI_KIND=build - XARCH=x64 - addons: - apt: - packages: - - texlive-latex-extra - - texlive-fonts-recommended - - env: >- - CI_KIND=build - XARCH=x64 - CONFIG_ARG=--disable-shared - - env: >- - CI_KIND=build - XARCH=x64 - MIN_BUILD=1 - - env: >- - CI_KIND=build - XARCH=x64 - CONFIG_ARG=--enable-dependency-generation - MAKE_ARG=-j - env: CI_KIND=check-depend - env: CI_KIND=changes - env: CI_KIND=manual - env: CI_KIND=check-typo -# - env: CI_KIND=tests -# allow_failures: -# - env: CI_KIND=tests -addons: - apt: - packages: - - binutils-dev notifications: email: diff --git a/ocamltest/ocaml_actions.ml b/ocamltest/ocaml_actions.ml index 9b8419b82..bd7e6a5ef 100644 --- a/ocamltest/ocaml_actions.ml +++ b/ocamltest/ocaml_actions.ml @@ -1083,6 +1083,7 @@ let config_variables _log env = Sys.getenv_with_default_value "MKDLL" Ocamltest_config.mkdll; Ocaml_variables.mkexe, Ocamltest_config.mkexe; Ocaml_variables.c_preprocessor, Ocamltest_config.c_preprocessor; + Ocaml_variables.cc, Ocamltest_config.cc; Ocaml_variables.csc, Ocamltest_config.csc; Ocaml_variables.csc_flags, Ocamltest_config.csc_flags; Ocaml_variables.shared_library_cflags, diff --git a/ocamltest/ocaml_variables.ml b/ocamltest/ocaml_variables.ml index b95156291..78c138ef9 100644 --- a/ocamltest/ocaml_variables.ml +++ b/ocamltest/ocaml_variables.ml @@ -41,6 +41,9 @@ let bytecc_libs = make ("bytecc_libs", let c_preprocessor = make ("c_preprocessor", "Command to use to invoke the C preprocessor") +let cc = make ("cc", + "Command to use to invoke the C compiler") + let caml_ld_library_path_name = "CAML_LD_LIBRARY_PATH" let export_caml_ld_library_path value = diff --git a/ocamltest/ocaml_variables.mli b/ocamltest/ocaml_variables.mli index 89686de1e..5487ea2f7 100644 --- a/ocamltest/ocaml_variables.mli +++ b/ocamltest/ocaml_variables.mli @@ -28,6 +28,8 @@ val bytecc_libs : Variables.t val c_preprocessor : Variables.t +val cc : Variables.t + val caml_ld_library_path : Variables.t val compare_programs : Variables.t diff --git a/testsuite/tests/lib-bigarray-2/bigarrfml.ml b/testsuite/tests/lib-bigarray-2/bigarrfml.ml index 40020b237..63bbf1d3f 100644 --- a/testsuite/tests/lib-bigarray-2/bigarrfml.ml +++ b/testsuite/tests/lib-bigarray-2/bigarrfml.ml @@ -8,7 +8,7 @@ script = "sh ${test_source_directory}/has-gfortran.sh" ** setup-ocamlc.byte-build-env *** script -script = "gfortran -c bigarrf.f" +script = "sh ${test_source_directory}/call-gfortran.sh ${cc} -c bigarrf.f" **** ocamlc.byte all_modules = "bigarrf.o bigarrfstub.c bigarrfml.ml" ***** run @@ -18,7 +18,7 @@ stdout = "${output}" ** setup-ocamlopt.byte-build-env *** script -script = "gfortran -c bigarrf.f" +script = "sh ${test_source_directory}/call-gfortran.sh ${cc} -c bigarrf.f" **** ocamlopt.byte all_modules = "bigarrf.o bigarrfstub.c bigarrfml.ml" ***** run diff --git a/testsuite/tests/lib-bigarray-2/call-gfortran.sh b/testsuite/tests/lib-bigarray-2/call-gfortran.sh new file mode 100644 index 000000000..5a250eb46 --- /dev/null +++ b/testsuite/tests/lib-bigarray-2/call-gfortran.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# This somewhat hackily passes any extra words in CC to gfortran +# This means for a 32-bit build (configured with CC="gcc -m32" the -m32 +# gets passed to gfortran) +shift 1 +gfortran "$@" diff --git a/tools/ci/actions/runner.sh b/tools/ci/actions/runner.sh new file mode 100755 index 000000000..9fcc61691 --- /dev/null +++ b/tools/ci/actions/runner.sh @@ -0,0 +1,133 @@ +#!/usr/bin/env bash +#************************************************************************** +#* * +#* OCaml * +#* * +#* Anil Madhavapeddy, OCaml Labs * +#* * +#* Copyright 2014 Institut National de Recherche en Informatique et * +#* en Automatique. * +#* * +#* All rights reserved. This file is distributed under the terms of * +#* the GNU Lesser General Public License version 2.1, with the * +#* special exception on linking described in the file LICENSE. * +#* * +#************************************************************************** + +set -xe + +PREFIX=~/local + +MAKE="make $MAKE_ARG" +SHELL=dash + +export PATH=$PREFIX/bin:$PATH + +Configure () { + mkdir -p $PREFIX + cat</dev/null ; then + echo Check the code examples in the manual + $MAKE manual-pregen + fi + # check_all_arches checks tries to compile all backends in place, + # we would need to redo (small parts of) world.opt afterwards to + # use the compiler again + $MAKE check_all_arches + # Ensure that .gitignore is up-to-date - this will fail if any untreacked or + # altered files exist. + test -z "$(git status --porcelain)" + # check that the 'clean' target also works + $MAKE clean + $MAKE -C manual clean + # check that the `distclean` target definitely cleans the tree + $MAKE distclean + # Check the working tree is clean + test -z "$(git status --porcelain)" + # Check that there are no ignored files + test -z "$(git ls-files --others -i --exclude-standard)" +} + +CheckManual () { + cat<