|
| 1 | +name: jane_ocaml5 |
| 2 | +on: [push, pull_request] |
| 3 | +jobs: |
| 4 | + jane_ocaml5: |
| 5 | + name: Check that resolved files build |
| 6 | + runs-on: ubuntu-latest |
| 7 | + steps: |
| 8 | + - name: Cache OCaml 4.14, dune, and menhir |
| 9 | + uses: actions/cache@v2 |
| 10 | + id: cache |
| 11 | + with: |
| 12 | + path: ${{ github.workspace }}/ocaml-414/_install |
| 13 | + key: ocaml-414-dune-361-menhir-20210419--v1 |
| 14 | + |
| 15 | + - name: Checkout OCaml 4.14 |
| 16 | + uses: actions/checkout@master |
| 17 | + if: steps.cache.outputs.cache-hit != 'true' |
| 18 | + with: |
| 19 | + repository: 'ocaml/ocaml' |
| 20 | + path: 'ocaml-414' |
| 21 | + ref: '4.14' |
| 22 | + |
| 23 | + - name: Build OCaml 4.14 |
| 24 | + if: steps.cache.outputs.cache-hit != 'true' |
| 25 | + working-directory: ocaml-414 |
| 26 | + run: | |
| 27 | + ./configure --prefix=$GITHUB_WORKSPACE/ocaml-414/_install |
| 28 | + make -j $J world.opt |
| 29 | + make install |
| 30 | + # Remove unneeded parts to shrink cache file |
| 31 | + rm -rf $GITHUB_WORKSPACE/ocaml-414/_install/{lib/ocaml/expunge,bin/*.byte} |
| 32 | +
|
| 33 | + - name: Checkout dune github repo |
| 34 | + uses: actions/checkout@master |
| 35 | + if: steps.cache.outputs.cache-hit != 'true' |
| 36 | + with: |
| 37 | + repository: 'ocaml/dune' |
| 38 | + ref: '3.6.1' |
| 39 | + path: 'dune' |
| 40 | + |
| 41 | + - name: Build dune |
| 42 | + working-directory: dune |
| 43 | + if: steps.cache.outputs.cache-hit != 'true' |
| 44 | + run: | |
| 45 | + PATH=$GITHUB_WORKSPACE/ocaml-414/_install/bin:$PATH make release |
| 46 | + cp _boot/dune.exe $GITHUB_WORKSPACE/ocaml-414/_install/bin/dune |
| 47 | +
|
| 48 | + - name: Checkout menhir github repo |
| 49 | + uses: actions/checkout@master |
| 50 | + if: steps.cache.outputs.cache-hit != 'true' |
| 51 | + with: |
| 52 | + repository: 'LexiFi/menhir' |
| 53 | + ref: '20210419' |
| 54 | + path: 'menhir' |
| 55 | + |
| 56 | + - name: Build menhir |
| 57 | + working-directory: menhir |
| 58 | + if: steps.cache.outputs.cache-hit != 'true' |
| 59 | + run: | |
| 60 | + PATH=$GITHUB_WORKSPACE/ocaml-414/_install/bin:$PATH dune build |
| 61 | + cp _build/install/default/bin/menhir $GITHUB_WORKSPACE/ocaml-414/_install/bin/menhir |
| 62 | + # Our dune rule uses `menhirLib.mli`, which we can't simply `cp` |
| 63 | + # because it's a symbolic link to a relative path. |
| 64 | + export TARGET_FILE=$GITHUB_WORKSPACE/ocaml-414/_install/lib/menhirLib/menhirLib.mli |
| 65 | + mkdir -p $(dirname $TARGET_FILE) |
| 66 | + cat _build/install/default/lib/menhirLib/menhirLib.mli > $TARGET_FILE |
| 67 | +
|
| 68 | + - name: Checkout the ocaml-jst repo |
| 69 | + uses: actions/checkout@master |
| 70 | + with: |
| 71 | + path: 'ocaml-jst' |
| 72 | + |
| 73 | + - name: Configure |
| 74 | + working-directory: ocaml-jst |
| 75 | + run: | |
| 76 | + ./configure --prefix=$GITHUB_WORKSPACE/ocaml-5/_install --with-dune=$GITHUB_WORKSPACE/ocaml-414/_install/bin/dune |
| 77 | +
|
| 78 | + - name: Check that resolved files build |
| 79 | + working-directory: ocaml-jst |
| 80 | + run: | |
| 81 | + export PATH=$GITHUB_WORKSPACE/ocaml-414/_install/bin:$PATH |
| 82 | + jane/build-resolved-files-for-ci |
0 commit comments