forked from stellar/stellar-core
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (65 loc) · 2.35 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
name: CI
on:
pull_request:
push:
branches:
- auto
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: [ "gcc", "clang"]
protocol: ["current", "next"]
scenario: ["", "--check-test-tx-meta"]
steps:
- name: Compute cache key
# this step works around a limitation in actions/cache
# that does not allow updating a cache
# so what we do here instead is
# 1. generate a new id that gets refreshed every hour
# the limit is to reduce the chance of hitting the
# global 5GB limit per repo
# 2. use that id as part of the cache identifier
# 3. fallback (restore-keys) to the most recent cache
id: cache_extra_id
run: |
echo "::set-output name=id::$(( $(date +'%s') / 60 / 60 ))"
- name: Cache
uses: actions/[email protected]
with:
path: |
/home/runner/.ccache
key: ${{ runner.os }}-${{ matrix.toolchain }}-${{ matrix.protocol }}-cacheID-${{ steps.cache_extra_id.outputs.id }}
restore-keys: |
${{ runner.os }}-${{ matrix.toolchain }}-${{ matrix.protocol }}-cacheID-
- uses: actions/checkout@v2
with:
fetch-depth: 200
submodules: true
- name: install core packages
run: |
sudo apt-get update
sudo apt-get -y install --no-install-recommends apt-utils dialog git iproute2 procps lsb-release
- name: install tool chain
run: |
sudo apt-get -y install libstdc++-8-dev clang-format-10 ccache cargo rustc
if test "${{ matrix.toolchain }}" = "gcc" ; then
sudo apt-get -y install cpp-8 gcc-8 g++-8
else
sudo apt-get -y install clang-10 llvm-10
fi
- name: install dependencies
run: sudo apt-get -y install postgresql git build-essential pkg-config autoconf automake libtool bison flex libpq-dev parallel libunwind-dev
- name: Build
run: |
if test "${{ matrix.toolchain }}" = "gcc" ; then
export CC='gcc'
export CXX='g++'
else
export CC='clang'
export CXX='clang++'
fi
echo Build with $CC and $CXX
./ci-build.sh --use-temp-db --protocol ${{ matrix.protocol }} ${{ matrix.scenario }}