]> Untitled Git - bdk-cli/commitdiff
Add wasm build in CI
authorDaniela Brozzoni <danielabrozzoni@protonmail.com>
Tue, 20 Sep 2022 15:35:47 +0000 (17:35 +0200)
committerDaniela Brozzoni <danielabrozzoni@protonmail.com>
Sun, 25 Sep 2022 19:11:19 +0000 (21:11 +0200)
.github/workflows/cont_integration.yml

index 133bb28016ea9663272a9ebaf1ffaa98ec33b3a3..002d69da3fb95d100e66b4d053ce3c782f4bdca3 100644 (file)
@@ -55,6 +55,41 @@ jobs:
       - name: Test
         run: cargo test --no-default-features --features repl,${{ matrix.features }}
 
+  wasm-build:
+    name: Build WASM
+    runs-on: ubuntu-latest
+    env:
+      CC: clang-10
+      CFLAGS: -I/usr/include
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
+      - name: Generate cache key
+        run: echo "Build WASM" | tee .cache_key
+      - name: Cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.cargo/registry
+            ~/.cargo/git
+            target
+          key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
+        # Install a recent version of clang that supports wasm32
+      - run: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
+      - run: sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main" || exit 1
+      - run: sudo apt-get update || exit 1
+      - run: sudo apt-get install -y libclang-common-10-dev clang-10 libc6-dev-i386 || exit 1
+      - name: Set default toolchain
+        run: rustup default 1.56.1 # MSRV
+      - name: Set profile
+        run: rustup set profile minimal
+      - name: Add target wasm32
+        run: rustup target add wasm32-unknown-unknown
+      - name: Update toolchain
+        run: rustup update
+      - name: Build
+        run: cargo build --target wasm32-unknown-unknown --no-default-features --features esplora-reqwest,async-interface,compiler
+
   fmt:
     name: Rust fmt
     runs-on: ubuntu-latest