-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (67 loc) · 2.47 KB
/
test-build.yml
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
name: Build per OS
on:
workflow_dispatch:
jobs:
build:
env:
GRPC_BUILD_ENABLE_CCACHE: "ON"
runs-on: ${{matrix.host}}
strategy:
fail-fast: false
matrix:
target: [OSX, Android, iOS]
build_type: [Debug, Release]
include:
# - target: Linux
# host: ubuntu-latest
# - target: Windows
# host: windows-latest
- target: OSX
host: macos-latest
- target: Android
host: ubuntu-latest
- target: iOS
host: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set clang as the default compiler
if: ${{ matrix.host == 'ubuntu-latest' }}
run: |
sudo update-alternatives --install /usr/bin/cc cc $(which clang) 100
sudo update-alternatives --install /usr/bin/c++ c++ $(which clang++) 100
sudo update-alternatives --set cc $(which clang)
sudo update-alternatives --set c++ $(which clang++)
- name: Install Linux dependencies
if: ${{ matrix.host == 'ubuntu-latest'}}
run: |
sudo apt install ccache -y
sudo apt install ninja-build -y
echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV
- name: Install Windows dependencies
if: ${{ matrix.host == 'windows-latest'}}
run: |
choco install ccache -A
- name: Install Darwin dependencies
if: ${{ matrix.host == 'macos-latest'}}
run: |
brew install ccache
- name: Install bindgen
run: cargo install cbindgen
- name: Add iOS toolchain
if: ${{ matrix.target == 'iOS' }}
run: |
rustup toolchain install nightly-aarch64-apple-darwin
rustup target add aarch64-apple-ios
- name: Add Android toolchain
if: ${{ matrix.target == 'Android' }}
run: |
rustup target add aarch64-linux-android
- name: Add Rust target
run: rustup target add wasm32-unknown-emscripten
- name: Configure CMake
run: cmake -S build/${{matrix.target}} -B build/${{matrix.target}}/${{matrix.build_type}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
- name: Build project
run: cmake --build build/${{matrix.target}}/${{matrix.build_type}} --config ${{matrix.build_type}} --target wallet-core --verbose