]> git.bitcoin.ninja Git - ldk-java/commitdiff
wip
authorMatt Corallo <git@bluematt.me>
Wed, 24 Mar 2021 02:53:26 +0000 (22:53 -0400)
committerMatt Corallo <git@bluematt.me>
Wed, 24 Mar 2021 03:17:01 +0000 (23:17 -0400)
.github/workflows/build.yml

index 72ff307a81b8122c1fbf74258ee502ff025cc8c1..400ec53b0c7af49d063afc55994a2e0592c48c16 100644 (file)
@@ -15,7 +15,7 @@ jobs:
         run: |
           apt-get update
           apt-get -y dist-upgrade
-          apt-get -y install cargo libstd-rust-dev-wasm32 valgrind lld git g++ clang openjdk-11-jdk maven
+          apt-get -y install cargo libstd-rust-dev-wasm32 valgrind lld git g++ clang
       - name: Checkout source code
         uses: actions/checkout@v2
       - name: Install cbindgen
@@ -30,12 +30,34 @@ jobs:
           cd ..
           git clone https://github.com/lightningdevkit/ldk-c-bindings
           cd ldk-c-bindings
-          sed -i 's|# Now cd to lightning-c-bindings, build the generated bindings, and call cbindgen to build a C header file|export RUSTFLAGS="--remap-path-prefix $LIGHTNING_PATH=rust-lightning --remap-path-prefix $HOME/.cargo= -Z no-parallel-llvm"\nexport RUSTC_BOOTSTRAP=1|' genbindings.sh
-          cd ..
+          sed -i 's|# Now cd to lightning-c-bindings, build the generated bindings, and call cbindgen to build a C header file|export RUSTFLAGS="--remap-path-prefix $LIGHTNING_PATH=rust-lightning --remap-path-prefix $HOME/.cargo= -C target-cpu=generic"\nwhich rustc|' genbindings.sh
       - name: Rebuild C bindings, and check the sample app builds + links
-        run: cd ldk-c-bindings && ./genbindings.sh ../rust-lightning && cd ..
+        run: |
+          export PATH="$(pwd)/ci:$PATH"
+          cd ldk-c-bindings
+          export CC=clang
+          #export CFLAGS=-flto
+          export CFLAGS_wasm32_wasi="-target wasm32"
+          which rustc
+          echo "OK...$PATH"
+          ./genbindings.sh ../rust-lightning
+          cd lightning-c-bindings
+          sha256sum target/debug/libldk.a target/debug/libldk.so
+          sha256sum target/release/libldk.a target/release/libldk.so
+          sha256sum target/wasm32-wasi/release/ldk.wasm target/wasm32-wasi/release/libldk.a
+          cd ../..
+      - name: Upload builds to compare 0
+        uses: actions/upload-artifact@v2
+        with:
+          name: wasm_bindings
+          path: ldk-c-bindings/lightning-c-bindings/target/wasm32-wasi/*/*ldk*
+      - name: Upload builds to compare 4
+        uses: actions/upload-artifact@v2
+        with:
+          name: c_bindings
+          path: ldk-c-bindings/lightning-c-bindings/log*
       - name: Build Java/TS 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
+        run: exit 1 && export SOURCE_DATE_EPOCH=1616474792 && ./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
       - name: Run Java Tests against Debug Bindings
         run: |
           rm liblightningjni.so
@@ -46,7 +68,17 @@ jobs:
           mvn test
           git checkout liblightningjni.so
       - name: Build Java/TS 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
+        run: export SOURCE_DATE_EPOCH=1616474792 && ./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: Upload builds to compare
+        uses: actions/upload-artifact@v2
+        with:
+          name: jni_release
+          path: liblightningjni_release.so
+      - name: Upload builds to compare 2
+        uses: actions/upload-artifact@v2
+        with:
+          name: jni_debug
+          path: liblightningjni_debug.so
       - name: Check latest headers are in git
         run: |
           git diff --exit-code