|
| 1 | +name: build |
| 2 | +on: [push, pull_request] |
| 3 | +jobs: |
| 4 | + build: |
| 5 | + name: ${{ matrix.name }} |
| 6 | + runs-on: ${{ matrix.os }} |
| 7 | + |
| 8 | + strategy: |
| 9 | + fail-fast: false |
| 10 | + matrix: |
| 11 | + include: |
| 12 | + - name: closure-nnp-local |
| 13 | + config: --enable-stack-allocation |
| 14 | + os: ubuntu-latest |
| 15 | + ocamlparam: '' |
| 16 | + check_arch: true |
| 17 | + |
| 18 | + - name: flambda-local |
| 19 | + config: --enable-flambda --enable-stack-allocation |
| 20 | + os: ubuntu-latest |
| 21 | + |
| 22 | + - name: i386 |
| 23 | + config: CC='cc32' AS='as --32' ASPP='gcc -m32 -c' -host i386-linux PARTIALLD='ld -r -melf_i386' |
| 24 | + os: ubuntu-latest |
| 25 | + ocamlparam: '' |
| 26 | + boot_config: CC='cc32' AS='as --32' ASPP='gcc -m32 -c' -host i386-linux PARTIALLD='ld -r -melf_i386' |
| 27 | + boot_cachekey: 32bit |
| 28 | + |
| 29 | + env: |
| 30 | + J: "3" |
| 31 | + |
| 32 | + steps: |
| 33 | + - name: Install GNU parallel |
| 34 | + if: matrix.os == 'macos-latest' |
| 35 | + run: HOMEBREW_NO_INSTALL_CLEANUP=TRUE brew install parallel |
| 36 | + |
| 37 | + - name: Install GCC 32-bit libraries |
| 38 | + if: matrix.name == 'i386' |
| 39 | + run: | |
| 40 | + sudo apt-get install gcc-multilib gfortran-multilib |
| 41 | +
|
| 42 | + - name: Checkout the ocaml-jst repo |
| 43 | + uses: actions/checkout@master |
| 44 | + with: |
| 45 | + path: 'ocaml-jst' |
| 46 | + |
| 47 | + - name: Cache OCaml 4.12 and dune |
| 48 | + uses: actions/cache@v1 |
| 49 | + id: cache |
| 50 | + with: |
| 51 | + path: ${{ github.workspace }}/ocaml-412/_install |
| 52 | + key: ${{ matrix.os }}-cache-ocaml-412-dune-341-bits-${{ matrix.boot_cachekey }} |
| 53 | + |
| 54 | + - name: Checkout OCaml 4.12 |
| 55 | + uses: actions/checkout@master |
| 56 | + if: steps.cache.outputs.cache-hit != 'true' |
| 57 | + with: |
| 58 | + repository: 'ocaml/ocaml' |
| 59 | + path: 'ocaml-412' |
| 60 | + ref: '4.12' |
| 61 | + |
| 62 | + - name: Setup 32-bit C compiler |
| 63 | + if: matrix.name == 'i386' && steps.cache.outputs.cache-hit != 'true' |
| 64 | + run: | |
| 65 | + mkdir -p ocaml-412/_install/bin |
| 66 | + { echo '#!/bin/sh'; echo 'exec gcc -m32 "$@"'; } > ocaml-412/_install/bin/cc32 |
| 67 | + chmod +x ocaml-412/_install/bin/cc32 |
| 68 | +
|
| 69 | + - name: Build OCaml 4.12 |
| 70 | + if: steps.cache.outputs.cache-hit != 'true' |
| 71 | + working-directory: ocaml-412 |
| 72 | + run: | |
| 73 | + export PATH=$GITHUB_WORKSPACE/ocaml-412/_install/bin:$PATH |
| 74 | + ./configure --prefix=$GITHUB_WORKSPACE/ocaml-412/_install ${{ matrix.boot_config }} |
| 75 | + make -j $J world.opt |
| 76 | + make install |
| 77 | + # Remove unneeded parts to shrink cache file |
| 78 | + rm -rf $GITHUB_WORKSPACE/ocaml-412/_install/{lib/ocaml/compiler-libs,lib/ocaml/expunge,bin/*.byte} |
| 79 | +
|
| 80 | + - name: Checkout dune github repo |
| 81 | + uses: actions/checkout@master |
| 82 | + if: steps.cache.outputs.cache-hit != 'true' |
| 83 | + with: |
| 84 | + repository: 'ocaml/dune' |
| 85 | + ref: '3.4.1' |
| 86 | + path: 'dune' |
| 87 | + |
| 88 | + - name: Build dune |
| 89 | + working-directory: dune |
| 90 | + if: steps.cache.outputs.cache-hit != 'true' |
| 91 | + run: | |
| 92 | + PATH=$GITHUB_WORKSPACE/ocaml-412/_install/bin:$PATH make release |
| 93 | + cp dune.exe $GITHUB_WORKSPACE/ocaml-412/_install/bin/dune |
| 94 | +
|
| 95 | + - name: Configure OCaml |
| 96 | + working-directory: ocaml-jst |
| 97 | + run: | |
| 98 | + export PATH=$GITHUB_WORKSPACE/ocaml-412/_install/bin:$PATH |
| 99 | + autoconf |
| 100 | + ./configure \ |
| 101 | + --prefix=$GITHUB_WORKSPACE/_install \ |
| 102 | + ${{ matrix.config }} |
| 103 | +
|
| 104 | + - name: Build, install and test ocaml-jst |
| 105 | + working-directory: ocaml-jst |
| 106 | + run: | |
| 107 | + export PATH=$GITHUB_WORKSPACE/ocaml-412/_install/bin:$PATH |
| 108 | + make -f Makefile.jst runtest-upstream |
| 109 | + env: |
| 110 | + BUILD_OCAMLPARAM: ${{ matrix.ocamlparam }} |
0 commit comments