run: |
cd ldk-c-bindings
./genbindings.sh ../rust-lightning false
- - name: Build and Test TS Bindings for Node
+ - name: Build and Test TS Debug Bindings for Node
run: |
# We need FinalizationRegistry and top-level await support, which requires node 14.6/8,
# however Debian ships with Node 12
# Thus, we install the binary nodejs from nodejs.org and test with that.
curl https://nodejs.org/dist/v16.13.1/node-v16.13.1-linux-x64.tar.xz > nodejs.tar.xz
tar xvvf nodejs.tar.xz
- export PATH=$(echo node-*/bin):$PATH
+ export PATH=$(pwd)/$(echo node-*/bin):$PATH
+ ./genbindings.sh ./ldk-c-bindings/ wasm true false
+ - name: Build and Test TS Release Bindings for Node
+ run: |
+ export PATH=$(pwd)/$(echo node-*/bin):$PATH
./genbindings.sh ./ldk-c-bindings/ wasm false false
- - name: Build and Test TS Bindings for Web
+ - name: Install Playwright for Web Tests
run: |
- export PATH=$(echo node-*/bin):$PATH
- ./genbindings.sh ./ldk-c-bindings/ wasm false true
export HOME=/root/ # Github actions is apparently broken
- npm i -D playwright
+ export PATH=$(pwd)/$(echo node-*/bin):$PATH
# npx playwright install-deps is broken so we do it manually, see https://github.com/microsoft/playwright/issues/11165
apt-get install -y --no-install-recommends fonts-liberation libenchant-2-2 libicu67 libjpeg62-turbo libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 libcups2 libdbus-1-3 libdrm2 libegl1 libgbm1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxrandr2 libxshmfence1 xvfb fonts-noto-color-emoji fonts-unifont libfontconfig libfreetype6 xfonts-scalable fonts-ipafont-gothic fonts-wqy-zenhei fonts-tlwg-loma-otf ffmpeg libcairo-gobject2 libdbus-glib-1-2 libfontconfig1 libgdk-pixbuf2.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libxcb-shm0 libxcursor1 libxi6 libxrender1 libxt6 gstreamer1.0-libav gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good libepoxy0 libevdev2 libgl1 libgles2 libgstreamer-gl1.0-0 libgstreamer1.0-0 libharfbuzz-icu0 libharfbuzz0b libhyphen0 libnotify4 libopenjp2-7 libopus0 libpng16-16 libsecret-1-0 libsoup2.4-1 libwayland-client0 libwayland-egl1 libwayland-server0 libwebp6 libwebpdemux2 libwoff1 libxkbcommon0 libxml2 libxslt1.1
mkdir -p $HOME/.cache/ms-playwright # `playwright install` is too dumb to create this for us
chmod -R 777 $HOME/
+ npm i -D playwright
npx playwright install
- export PATH=$(echo node-*/bin):$PATH
+ - name: Build and Test TS Debug Bindings for Web
+ run: |
+ export HOME=/root/ # Github actions is apparently broken
+ export PATH=$(pwd)/$(echo node-*/bin):$PATH
+ ./genbindings.sh ./ldk-c-bindings/ wasm true true
+ cd ts
+ rm liblightningjs.wasm && ln -s $(pwd)/../liblightningjs_debug.wasm ./liblightningjs.wasm
+ python3 -m http.server &
+ SERVER_PID=$!
+ node test/browser.mjs
+ kill $SERVER_PID
+ - name: Build and Test TS Release Bindings for Web
+ run: |
+ export HOME=/root/ # Github actions is apparently broken
+ export PATH=$(pwd)/$(echo node-*/bin):$PATH
+ ./genbindings.sh ./ldk-c-bindings/ wasm false true
+ cd ts
+ rm liblightningjs.wasm && ln -s $(pwd)/../liblightningjs_release.wasm ./liblightningjs.wasm
python3 -m http.server &
- node ts/test/browser.mjs
+ SERVER_PID=$!
+ node test/browser.mjs
+ kill $SERVER_PID
- name: Check latest TS files are in git
run: |
git diff --exit-code
- name: Rebuild C bindings, and check the sample app builds + links
run: |
cd ldk-c-bindings
- # Reset the Cargo.toml file so that git describe doesn't think we're "-dirty"
- git checkout lightning-c-bindings/Cargo.toml
./genbindings.sh ../rust-lightning true
- name: Build Java Debug Bindings
run: ./genbindings.sh ./ldk-c-bindings/ "-I/usr/lib/jvm/java-11-openjdk-amd64/include/ -I/usr/lib/jvm/java-11-openjdk-amd64/include/linux/" true false
mv liblightningjni_debug_Linux-amd64.so liblightningjni.so
export ASAN_OPTIONS=detect_leaks=0
LD_PRELOAD=/usr/lib/llvm-11/lib/clang/11.0.1/lib/linux/libclang_rt.asan-x86_64.so LD_LIBRARY_PATH=. mvn test
+ - name: Build Java Release Bindings
+ run: |
+ ./genbindings.sh ./ldk-c-bindings/ "-I/usr/lib/jvm/java-11-openjdk-amd64/include/ -I/usr/lib/jvm/java-11-openjdk-amd64/include/linux/" false false
+ - name: Check latest headers are in git
+ run: |
+ git checkout pom.xml
+ git diff --exit-code
+
+ java_determinism:
+ runs-on: ubuntu-latest
+ # Ubuntu's version of rustc uses its own LLVM instead of being a real native package.
+ # This leaves us with an incompatible LLVM version when linking. Instead, use a real OS.
+ container: debian:bullseye
+ strategy:
+ fail-fast: false
+ steps:
+ - name: Install native Rust toolchain, Valgrind, and build utilitis
+ run: |
+ apt-get update
+ apt-get -y dist-upgrade
+ apt-get -y install cargo valgrind lld git g++ clang openjdk-11-jdk maven faketime zip unzip llvm curl
+ - name: Checkout source code
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+ - name: Install cbindgen
+ run: cargo install --force cbindgen
+ - name: Checkout Rust-Lightning and LDK-C-Bindings git
+ run: |
+ git config --global user.email "ldk-ci@example.com"
+ git config --global user.name "LDK CI"
+ # Note this is a different endpoint, as we need one non-upstream commit!
+ git clone https://git.bitcoin.ninja/rust-lightning
+ cd rust-lightning
+ git checkout origin/2021-03-java-bindings-base
+ cd ..
+ git clone https://github.com/lightningdevkit/ldk-c-bindings
+ cd ldk-c-bindings
+ git checkout 0.0.104
+ - name: Rebuild C bindings, and check the sample app builds + links
+ run: |
+ cd ldk-c-bindings
+ ./genbindings.sh ../rust-lightning true
- name: Checkout latest MacOS binaries
run: |
export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
./genbindings.sh ./ldk-c-bindings/ "-I/usr/lib/jvm/java-11-openjdk-amd64/include/ -I/usr/lib/jvm/java-11-openjdk-amd64/include/linux/" false false
- name: Build deterministic release jar
run: ./build-release-jar.sh
- - name: Check latest headers are in git
- run: |
- git checkout pom.xml
- git diff --exit-code
- name: Check latest library and jars are in bins repo
run: |
export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"