@@ -105,6 +105,52 @@ jobs:
105105 with :
106106 node-version : lts/*
107107
108+ - name : Restore cached binaryen
109+ id : cache-binaryen
110+ uses : actions/cache/restore@v4
111+ with :
112+ path : binaryen
113+ key : ${{ runner.os }}-binaryen-version_118
114+
115+ - name : Checkout binaryen
116+ if : steps.cache-binaryen.outputs.cache-hit != 'true'
117+ uses : actions/checkout@v4
118+ with :
119+ repository : WebAssembly/binaryen
120+ path : binaryen
121+ submodules : true
122+ ref : version_118
123+
124+ - name : Install ninja (Ubuntu)
125+ if : matrix.os == 'ubuntu-latest' && steps.cache-binaryen.outputs.cache-hit != 'true'
126+ run : sudo apt-get install ninja-build
127+
128+ - name : Install ninja (MacOS)
129+ if : matrix.os == 'macos-latest' && steps.cache-binaryen.outputs.cache-hit != 'true'
130+ run : brew install ninja
131+
132+ - name : Install ninja (Windows)
133+ if : matrix.os == 'windows-latest' && steps.cache-binaryen.outputs.cache-hit != 'true'
134+ run : choco install ninja
135+
136+ - name : Build binaryen
137+ if : steps.cache-binaryen.outputs.cache-hit != 'true'
138+ working-directory : ./binaryen
139+ run : |
140+ cmake -G Ninja .
141+ ninja
142+
143+ - name : Cache binaryen
144+ if : steps.cache-binaryen.outputs.cache-hit != 'true'
145+ uses : actions/cache/save@v4
146+ with :
147+ path : binaryen
148+ key : ${{ runner.os }}-binaryen-version_118
149+
150+ - name : Set binaryen's path
151+ run : |
152+ echo "$GITHUB_WORKSPACE/binaryen/bin" >> $GITHUB_PATH
153+
108154 - name : Set-up OCaml ${{ matrix.ocaml-compiler }}
109155 uses : ocaml/setup-ocaml@v3
110156 with :
0 commit comments