Get a working build for PyBaMM – with IDAKLU enabled #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build WASM dependencies and PyBaMM | |
on: | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends \ | |
cmake bzip2 ccache f2c g++ gfortran git make \ | |
patch pkg-config swig unzip wget xz-utils \ | |
autoconf autotools-dev automake texinfo dejagnu \ | |
build-essential libtool libltdl-dev \ | |
gnupg2 libdbus-glib-1-2 sudo sqlite3 \ | |
ninja-build jq xxd | |
- name: Cache ccache outputs | |
uses: actions/cache/restore@v4 | |
with: | |
path: /tmp/ccache | |
key: ccache-${{ hashFiles('Makefile.envs') }} | |
- name: Check out Pyodide | |
uses: actions/checkout@v4 | |
with: | |
repository: pyodide/pyodide | |
path: pyodide_checkout | |
submodules: recursive | |
- name: Overwrite previous recipes and copy new ones | |
run: cp -r recipes/* pyodide_checkout/packages/ | |
- name: Restore cached built packages | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
pyodide_checkout/packages/.libs/* | |
pyodide_checkout/packages/.artifacts/* | |
key: pyodide-packages-${{ hashFiles('pyodide_checkout/packages/recipes/**/*.yaml') }} | |
- name: Build Pyodide distribution | |
working-directory: pyodide_checkout/ | |
run: | | |
source pyodide_env.sh | |
ccache -z | |
PYODIDE_CORES=$(nproc) | |
PYODIDE_JOBS="${PYODIDE_CORES}" PYODIDE_PACKAGES="pybamm" make | |
ccache -s | |
- name: Save ccached outputs | |
uses: actions/cache/save@v4 | |
with: | |
path: /tmp/ccache | |
key: ccache-${{ hashFiles('Makefile.envs') }} | |
- name: Upload Pyodide distribution | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pyodide_dist | |
path: pyodide_checkout/dist/* | |
if-no-files-found: error |