-
Notifications
You must be signed in to change notification settings - Fork 4
87 lines (85 loc) · 3.04 KB
/
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
80
81
82
83
84
85
86
87
name: Build
on:
pull_request:
push:
branches:
- main
- release
- release/**
jobs:
linux_build:
name: Linux
runs-on: ubuntu-latest
steps:
# install conan
- uses: turtlebrowser/get-conan@main
# setup build dependencies
- run: sudo apt install -y libgflags-dev libprotobuf-dev libsodium-dev protobuf-compiler xsltproc
# checkout
- uses: actions/checkout@v3
with:
submodules: recursive
# restore cache (conan)
- uses: actions/cache@v3
with:
path: /home/runner/.conan
key: ${{ runner.os }}-conan-v2-${{ hashFiles('packages.txt') }}
# restore cache (appbase)
- id: appbase-cache
run: echo "version=$(git submodule status | awk '/appbase/{ print $1 }')" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: build/libs/appbase/libappbase.a
key: ${{ runner.os }}-appbase-${{ steps.appbase-cache.outputs.version }}
# restore cache (softfloat)
- id: softfloat-cache
run: echo "version=$(git submodule status | awk '/softfloat/{ print $1 }')" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: build/libs/softfloat/libsoftfloat.a
key: ${{ runner.os }}-softfloat-${{ steps.softfloat-cache.outputs.version }}
# build
- run: cmake -E make_directory build
- run: BOOST_ROOT=/opt/boost cmake .. -DUSE_CACHED_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DCHECK_CONNECTION=OFF && make -j2
working-directory: ./build
# test
# - run: make test
# working-directory: ./build
darwin_build:
name: MacOS
runs-on: macos-latest
steps:
# install conan
- uses: turtlebrowser/get-conan@main
# setup build dependencies
- run: brew install boost gflags libsodium openssl@3 protobuf
# checkout
- uses: actions/checkout@v3
with:
submodules: recursive
# restore cache (conan)
- uses: actions/cache@v3
with:
path: /home/runner/.conan
key: ${{ runner.os }}-conan-v2-${{ hashFiles('packages_macos.txt') }}
# restore cache (appbase)
- id: appbase-cache
run: echo "version=$(git submodule status | awk '/appbase/{ print $1 }')" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: build/libs/appbase/libappbase.a
key: ${{ runner.os }}-appbase-${{ steps.appbase-cache.outputs.version }}
# restore cache (softfloat)
- id: softfloat-cache
run: echo "version=$(git submodule status | awk '/softfloat/{ print $1 }')" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: build/libs/softfloat/libsoftfloat.a
key: ${{ runner.os }}-softfloat-${{ steps.softfloat-cache.outputs.version }}
# build
- run: cmake -E make_directory build
- run: cmake .. -DUSE_CACHED_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DCHECK_CONNECTION=OFF && make -j2
working-directory: ./build
# test
# - run: make test
# working-directory: ./build