forked from SatoshiPortal/boltz-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (61 loc) · 1.96 KB
/
build.yaml
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
on:
push:
branches:
- master
pull_request:
name: build
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- nightly
steps:
- name: checkout
uses: actions/checkout@v3
- name: Generate cache key
run: echo "${{ matrix.rust }}" | 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') }}
- name: Set default toolchain
run: rustup default ${{ matrix.rust }}
- name: Add wasm target
run: rustup target add wasm32-unknown-unknown
- name: Set profile
run: rustup set profile minimal
- name: Update toolchain
run: rustup update
- name: Build
run: make cargo-build
- name: Build wasm
run: make wasm-build
build-as-wasm-dependency:
name: Build as wasm dependency
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Add wasm target
run: rustup target add wasm32-unknown-unknown
- name: Install wasm-pack
run: cargo install wasm-pack
- name: Create wasm project
run: |
wasm-pack new wasm-project
cd wasm-project
sed -i.bak -e 's/edition = .*/edition = "2021"/' Cargo.toml
rm Cargo.toml.bak
# Patch needed until secp256k1-zkp wasm compatibility is fixed
echo -e '\n[workspace]\n\n[patch.crates-io]\nsecp256k1-zkp = { git = "https://github.com/danielgranhao/rust-secp256k1-zkp.git", rev = "e02a6d611f2844e0fb158537b4b3824d0341db61" }' >> Cargo.toml
# In this test, we reference the checked out repo (e.g. this PR branch)
cargo add --path ../ boltz-client
wasm-pack build --target web