-
Notifications
You must be signed in to change notification settings - Fork 1.6k
109 lines (106 loc) · 3.09 KB
/
linux-sampleapp-ci.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Linux SampleApps CI
on:
push:
branches: [ dev, master ]
pull_request:
branches: [ dev, master ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
# Work around https://github.com/actions/runner-images/issues/8659
- name: Remove GCC 13 from runner image
shell: bash
run: |
sudo rm -f /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-jammy.list
sudo apt-get update
sudo apt-get install -y --allow-downgrades libc6=2.35-0ubuntu3.5 libc6-dev=2.35-0ubuntu3.5 libstdc++6=12.3.0-1ubuntu1~22.04 libgcc-s1=12.3.0-1ubuntu1~22.04
- uses: actions/checkout@v3
- name: Install system dependencies
run: |
tools/install-sys-dependencies-linux
tools/install-rust-dependencies
- name: Cache internal dependencies
id: internal_cache
uses: actions/cache@v3
with:
path: build/local
key: ${{ runner.os }}-internal-${{ hashFiles('tools/install-dependencies') }}
- name: Install internal dependencies
run: |
tools/install-dependencies
env:
CC: /usr/bin/clang
CXX: /usr/bin/clang++
if: steps.internal_cache.outputs.cache-hit != 'true'
- name: Code generation
run: |
tools/generate-files native
env:
CC: /usr/bin/clang
CXX: /usr/bin/clang++
- name: CMake
run: |
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DTW_UNITY_BUILD=ON
env:
CC: /usr/bin/clang
CXX: /usr/bin/clang++
- name: Build
run: |
make -Cbuild -j12 TrustWalletCore
env:
CC: /usr/bin/clang
CXX: /usr/bin/clang++
CK_TIMEOUT_MULTIPLIER: 4
- name: Build and run C++ sample app
run: |
cd samples/cpp
cmake . -DWALLET_CORE=../../ -DCMAKE_BUILD_TYPE=Debug
make
./sample
env:
CC: /usr/bin/clang
CXX: /usr/bin/clang++
- name: Build, run, and test devconsole.ts
run: |
cd samples/typescript/devconsole.ts
npm install
npm run build
echo -e "help() \n .exit" | npm run start
npm run test
- name: Install Go
env:
GO_VERSION: 1.19
GO_ARCH: amd64
run: |
curl -O -L "https://golang.org/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz"
tar -xf "go${GO_VERSION}.linux-${GO_ARCH}.tar.gz"
sudo chown -R root:root ./go
sudo mv -v go /usr/local
- name: Build and run GoLang sample app
run: |
cd samples/go
go version
go build -o main
./main
env:
CC: /usr/bin/clang
CXX: /usr/bin/clang++
- name: Build Golang dev console
run: |
cd samples/go/dev-console
./prepare.sh
cd cmd && go build -o ../tw_dev_console && cd -
env:
CC: /usr/bin/clang
CXX: /usr/bin/clang++
- name: Build and run Rust sample app
run: |
cd samples/rust
rustc --version
cargo build
cargo run