-
Notifications
You must be signed in to change notification settings - Fork 112
81 lines (72 loc) · 2.97 KB
/
Copy pathgenerate-c-bindings.yml
File metadata and controls
81 lines (72 loc) · 2.97 KB
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
77
78
79
80
81
name: Build and test Ubuntu x64
on:
workflow_call:
inputs:
docker_image_tag:
required: true
type: string
version_tag:
required: false
type: string
default: ''
jobs:
generate-c-bindings:
timeout-minutes: 60
runs-on: ubuntu-24.04-arm
permissions:
contents: read # This is required for actions/checkout
container:
image: meshlib/meshlib-emscripten-generate-c-bindings-arm64:${{inputs.docker_image_tag}}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
ref: ${{inputs.version_tag}}
- name: Checkout third-party submodules
run: |
# have to checkout selective submodules by our own
# related issue: https://github.com/actions/checkout/issues/1779
export HOME=${RUNNER_TEMP}
git config --global --add safe.directory '*'
# Retried via retry.sh: submodule endpoints occasionally 500.
bash scripts/retry.sh -- git submodule update --init --depth 1 \
thirdparty/imgui \
thirdparty/eigen \
thirdparty/parallel-hashmap \
thirdparty/mrbind-pybind11 \
thirdparty/mrbind \
thirdparty/expected \
thirdparty/jsoncpp \
thirdparty/onetbb \
thirdparty/openvdb/v10/openvdb \
thirdparty/spdlog
# mrbind needs deps/cppdecl; recurse only there
bash scripts/retry.sh -- git -C thirdparty/mrbind submodule update --init --depth 1 deps/cppdecl
- name: Install MRBind
uses: ./.github/actions/build-mrbind
with:
# The Dockerfile hash in extra-cache-key busts the cache whenever the
# toolchain inside the image changes (e.g. glibc, clang upgrade).
cache-key-prefix: ubuntu-arm64-emscripten
build-script: scripts/mrbind/install_mrbind_ubuntu.sh
extra-cache-key: ${{ hashFiles('scripts/mrbind/clang_version.txt') }}
# We're not using the host headers here because it's more important to check that the normal way of building the bindings (i.e. using Emscripten headers) works,
# because you can do this on every OS, as opposed to using host headers, which only works on Linux x64.
- name: Generate C bindings (Wasm version)
run: |
cp -r source/MeshLibC2 source/MeshLibC2_orig
make -f scripts/mrbind/generate.mk TARGET=c -B --trace EM_USE_HOST_HEADERS=0 ENABLE_CUDA=1 C_FOR_WASM=1
mv source/MeshLibC2 source/MeshLibC2Wasm
mv source/MeshLibC2_orig source/MeshLibC2
- name: Generate C bindings
run: |
make -f scripts/mrbind/generate.mk TARGET=c -B --trace EM_USE_HOST_HEADERS=0 ENABLE_CUDA=1
- name: Upload C bindings
uses: actions/upload-artifact@v7
with:
name: CBindings
path: |
./source/MeshLibC2
./source/MeshLibC2Wasm
./source/MeshLibC2Cuda
retention-days: 1