-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (65 loc) · 2.23 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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