|
| 1 | +name: build |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + schedule: |
| 9 | + # Prime the caches every Monday |
| 10 | + - cron: 0 1 * * MON |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + os: |
| 18 | + - ubuntu-latest |
| 19 | + ocaml-compiler: |
| 20 | + - "4.08" |
| 21 | + - "4.09" |
| 22 | + - "4.10" |
| 23 | + - "4.11" |
| 24 | + - "4.12" |
| 25 | + - "4.13" |
| 26 | + - "5.0" |
| 27 | + - "5.1" |
| 28 | + skip-test: |
| 29 | + - true |
| 30 | + skip-doc: |
| 31 | + - true |
| 32 | + skip-effects: |
| 33 | + - true |
| 34 | + include: |
| 35 | + - os: ubuntu-latest |
| 36 | + ocaml-compiler: "4.14" |
| 37 | + skip-effects: true |
| 38 | + skip-test: false |
| 39 | + skip-doc: true |
| 40 | + - os: macos-latest |
| 41 | + ocaml-compiler: "4.14" |
| 42 | + skip-effects: true |
| 43 | + skip-test: false |
| 44 | + skip-doc: true |
| 45 | + - os: windows-latest |
| 46 | + ocaml-compiler: "4.14" |
| 47 | + skip-effects: true |
| 48 | + skip-test: false |
| 49 | + skip-doc: true |
| 50 | + - os: ubuntu-latest |
| 51 | + ocaml-compiler: "5.2" |
| 52 | + skip-effects: false |
| 53 | + skip-test: false |
| 54 | + skip-doc: false |
| 55 | + - os: macos-latest |
| 56 | + ocaml-compiler: "5.2" |
| 57 | + skip-effects: true |
| 58 | + skip-test: false |
| 59 | + skip-doc: true |
| 60 | + - os: windows-latest |
| 61 | + ocaml-compiler: "5.2" |
| 62 | + skip-effects: false |
| 63 | + skip-test: false |
| 64 | + skip-doc: true |
| 65 | + |
| 66 | + runs-on: ${{ matrix.os }} |
| 67 | + |
| 68 | + steps: |
| 69 | + - name: Set git to use LF |
| 70 | + if: matrix.ocaml-compiler < 5.2 |
| 71 | + run: | |
| 72 | + git config --global core.autocrlf false |
| 73 | + git config --global core.eol lf |
| 74 | + git config --global core.ignorecase false |
| 75 | +
|
| 76 | + - name: Checkout tree |
| 77 | + uses: actions/checkout@v4 |
| 78 | + |
| 79 | + - name: Set-up Node.js |
| 80 | + uses: actions/setup-node@v4 |
| 81 | + with: |
| 82 | + node-version: lts/* |
| 83 | + |
| 84 | + - name: Set-up OCaml ${{ matrix.ocaml-compiler }} |
| 85 | + uses: ocaml/setup-ocaml@v3 |
| 86 | + with: |
| 87 | + ocaml-compiler: ${{ matrix.ocaml-compiler }} |
| 88 | + dune-cache: true |
| 89 | + opam-pin: false |
| 90 | + |
| 91 | + - name: Pin dune |
| 92 | + run: | |
| 93 | + opam pin add dune.3.17 https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml |
| 94 | +
|
| 95 | + - run: opam install conf-pkg-config |
| 96 | + if: runner.os == 'Windows' |
| 97 | + |
| 98 | + - run: opam install . --best-effort |
| 99 | + if: ${{ matrix.skip-test }} |
| 100 | + |
| 101 | + - run: cat VERSION | xargs opam pin wasm_of_ocaml-compiler . -n --with-version |
| 102 | + if: ${{ !matrix.skip-test }} |
| 103 | + shell: bash |
| 104 | + |
| 105 | + - run: opam install conf-c++ |
| 106 | + # Otherwise, the next step fails reinstalling gcc while compiling |
| 107 | + # other packages |
| 108 | + if: ${{ !matrix.skip-test && runner.os == 'Windows' }} |
| 109 | + |
| 110 | + - run: opam install . --with-test --deps-only |
| 111 | + # Install the test dependencies |
| 112 | + if: ${{ !matrix.skip-test }} |
| 113 | + |
| 114 | + - run: opam install . |
| 115 | + # Install the packages (without running the tests) |
| 116 | + if: ${{ !matrix.skip-test }} |
| 117 | + |
| 118 | + - run: opam exec -- make all |
| 119 | + if: ${{ !matrix.skip-test }} |
| 120 | + |
| 121 | + - run: opam exec -- make tests |
| 122 | + if: ${{ !matrix.skip-test }} |
| 123 | + |
| 124 | + - run: opam exec -- dune build @all @runtest --profile using-effects |
| 125 | + if: ${{ !matrix.skip-effects }} |
| 126 | + |
| 127 | + - run: opam exec -- git diff --exit-code |
| 128 | + if: ${{ !matrix.skip-test }} |
| 129 | + |
| 130 | + - name: build doc |
| 131 | + if: ${{ !matrix.skip-doc && github.event_name == 'push' && github.ref_name == 'master'}} |
| 132 | + run: | |
| 133 | + opam install odoc lwt_log cohttp-lwt-unix yojson ocp-indent graphics higlo |
| 134 | + opam exec -- make doc |
| 135 | +
|
| 136 | + - name: synchronize doc |
| 137 | + if: ${{ !matrix.skip-doc && github.event_name == 'push' && github.ref_name == 'master' }} |
| 138 | + uses: JamesIves/github-pages-deploy-action@v4 |
| 139 | + with: |
| 140 | + branch: wikidoc |
| 141 | + folder: doc-dev |
| 142 | + clean: true |
| 143 | + target-folder: doc/dev/ |
| 144 | + |
| 145 | + lint-opam: |
| 146 | + runs-on: ubuntu-latest |
| 147 | + steps: |
| 148 | + - name: Checkout tree |
| 149 | + uses: actions/checkout@v4 |
| 150 | + - name: Set-up OCaml |
| 151 | + uses: ocaml/setup-ocaml@v3 |
| 152 | + with: |
| 153 | + ocaml-compiler: "5.2" |
| 154 | + dune-cache: true |
| 155 | + - name: Pin dune |
| 156 | + run: | |
| 157 | + opam pin add -n dune.3.17 https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml |
| 158 | + - uses: ocaml/setup-ocaml/lint-opam@v3 |
| 159 | + |
| 160 | + lint-fmt: |
| 161 | + runs-on: ubuntu-latest |
| 162 | + steps: |
| 163 | + - name: Checkout tree |
| 164 | + uses: actions/checkout@v4 |
| 165 | + - name: Set-up OCaml |
| 166 | + uses: ocaml/setup-ocaml@v3 |
| 167 | + with: |
| 168 | + ocaml-compiler: "5.2" |
| 169 | + dune-cache: true |
| 170 | + - name: Pin dune |
| 171 | + run: | |
| 172 | + opam pin add -n dune.3.17 https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml |
| 173 | + - uses: ocaml/setup-ocaml/lint-fmt@v3 |
| 174 | + |
| 175 | + lint-runtime: |
| 176 | + runs-on: ubuntu-latest |
| 177 | + steps: |
| 178 | + - name: Checkout tree |
| 179 | + uses: actions/checkout@v4 |
| 180 | + - name: Set-up Biome |
| 181 | + uses: biomejs/setup-biome@v2 |
| 182 | + - name: Run biome |
| 183 | + run: biome ci |
0 commit comments