@@ -62,13 +62,11 @@ jobs:
6262 uses : actions/cache@v4
6363 with :
6464 save-always : true
65- path : .ccache
65+ path : /home/runner/.cache
6666 key : ${{ runner.os }}-22.04-make-gcc-${{ github.ref }}-${{ github.sha }}-PR
6767 restore-keys : ${{ runner.os }}-22.04-make-gcc
68- - name : ccache environment
69- run : |
70- echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
71- echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
68+ - name : ccache path
69+ run : ccache -p | grep cache_dir
7270 - name : Get minisat
7371 run : make -C lib/cbmc/src minisat2-download
7472 - name : Build with make
@@ -213,10 +211,86 @@ jobs:
213211 asset_name : ${{ steps.create_packages.outputs.rpm_package_name }}
214212 asset_content_type : application/x-rpm
215213
214+ wasm-package :
215+ name : Package wasm
216+ runs-on : ubuntu-24.04
217+ needs : [perform-draft-release]
218+ outputs :
219+ wasm_package_name : ${{ steps.create_packages.outputs.wasm_package_name }}
220+ steps :
221+ - uses : actions/checkout@v4
222+ with :
223+ submodules : recursive
224+ - name : Fetch dependencies
225+ env :
226+ # This is needed in addition to -yq to prevent apt-get from asking for
227+ # user input
228+ DEBIAN_FRONTEND : noninteractive
229+ run : |
230+ sudo apt-get update
231+ sudo apt-get install --no-install-recommends -yq flex bison libxml2-utils cpanminus ccache
232+ - name : Install emscripten
233+ run : |
234+ # The emscripten package in Ubuntu is too far behind.
235+ git clone https://github.com/emscripten-core/emsdk.git
236+ cd emsdk
237+ git checkout 3.1.31
238+ ./emsdk install latest
239+ ./emsdk activate latest
240+ source ./emsdk_env.sh
241+ emcc --version
242+ - name : Prepare ccache
243+ uses : actions/cache@v4
244+ with :
245+ path : /home/runner/.cache
246+ save-always : true
247+ key : ${{ runner.os }}-24.04-make-emcc-${{ github.ref }}-${{ github.sha }}-PR
248+ restore-keys : |
249+ ${{ runner.os }}-24.04-make-emcc-${{ github.ref }}
250+ ${{ runner.os }}-24.04-make-emcc
251+ - name : Zero ccache stats and limit in size
252+ run : ccache -z --max-size=500M
253+ - name : ccache path
254+ run : ccache -p | grep cache_dir
255+ - name : Get minisat
256+ run : make -C lib/cbmc/src minisat2-download
257+ - name : Build with make
258+ run : |
259+ source emsdk/emsdk_env.sh
260+ make -C src -j4 \
261+ BUILD_ENV=Unix \
262+ CXX="ccache emcc -fwasm-exceptions" \
263+ LINKFLAGS="-sEXPORTED_RUNTIME_METHODS=callMain" \
264+ LINKLIB="emar rc \$@ \$^" \
265+ AR="emar" \
266+ EXEEXT=".html" \
267+ HOSTCXX="ccache g++" \
268+ HOSTLINKFLAGS=""
269+ - name : print version number via node.js
270+ run : node --no-experimental-fetch src/ebmc/ebmc.js --version
271+ - name : Create WASM package
272+ id : create_packages
273+ run : |
274+ (cd src/ebmc; tar cvfz ~/ebmc.tgz ebmc.js ebmc.wasm ebmc.html)
275+ VERSION=$(echo ${{ github.ref }} | cut -d "/" -f 3 | cut -d "-" -f 2)
276+ echo "wasm_package_path=${HOME}/ebmc.tgz" >> $GITHUB_OUTPUT
277+ echo "wasm_package_name=ebmc-${VERSION}-wasm.tgz" >> $GITHUB_OUTPUT
278+ - name : Print ccache stats
279+ run : ccache -s
280+ - name : Upload WASM
281+ uses : actions/upload-release-asset@v1
282+ env :
283+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
284+ with :
285+ upload_url : ${{ needs.perform-draft-release.outputs.upload_url }}
286+ asset_path : ${{ steps.create_packages.outputs.wasm_package_path }}
287+ asset_name : ${{ steps.create_packages.outputs.wasm_package_name }}
288+ asset_content_type : text/javascript
289+
216290 perform-release :
217291 name : Perform Release
218292 runs-on : ubuntu-20.04
219- needs : [ubuntu-22_04-package, centos8-package, get-version-information, perform-draft-release]
293+ needs : [ubuntu-22_04-package, centos8-package, wasm-package, get-version-information, perform-draft-release]
220294 steps :
221295 - name : Publish release
222296 env :
@@ -236,8 +310,7 @@ jobs:
236310
237311 ## Red Hat Linux and derivates
238312
239- For Red Hat, CentOS, Fedora, Amazon Linux,
240- install EBMC by downloading the *.rpm package below and then run
313+ For Red Hat, CentOS, Fedora, Amazon Linux, install EBMC by downloading the *.rpm package below and then run
241314
242315 \`\`\`sh
243316 rpm -i ${{ needs.centos8-package.outputs.rpm_package_name }}
0 commit comments