Skip to content

Commit

Permalink
gha: optimise the workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Sora Morimoto <sora@morimoto.io>
  • Loading branch information
smorimoto committed Jul 8, 2021
1 parent b42dc6e commit 521774e
Showing 1 changed file with 8 additions and 24 deletions.
32 changes: 8 additions & 24 deletions .github/workflows/build.yml
Expand Up @@ -16,42 +16,26 @@ jobs:
- ubuntu-latest
- macos-latest
ocaml-compiler:
- 4.10.2
- 4.10.x

runs-on: ${{ matrix.os }}

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

- name: Install pandoc
run: brew install pandoc

- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: ${{ matrix.os != 'macos-latest' }}

- name: Install Linux system packages
if: runner.os == 'Linux'
run: sudo apt-get -y update && sudo apt-get -y install libffi-dev libgmp-dev libpcre3-dev ncurses-dev pkg-config tzdata pandoc

- name: Install macOS system packages
if: runner.os == 'macOS'
run: brew install gmp libffi pcre pkg-config pandoc

- name: Retrieve cache
uses: actions/cache@v2
id: cache
with:
path: |
_build
~/.opam
key: dune-${{ runner.os }}-${{ matrix.ocaml-compiler }}-${{ github.sha }}
restore-keys: |
dune-${{ runner.os }}-${{ matrix.ocaml-compiler }}-${{ github.sha }}
dune-${{ runner.os }}-${{ matrix.ocaml-compiler }}-
- name: Install Dune
if: steps.cache.outputs.cache-hit != 'true'
run: opam install -y "dune>=2.9.0"
- name: Install dune
if: ${{ matrix.os == 'macos-latest' }}
run: opam install dune>=2.9.0

- name: Build HTML book
run: opam exec -- dune build @site
Expand Down

0 comments on commit 521774e

Please sign in to comment.