forked from yugabyte/yugabyte-db
-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (97 loc) · 3.3 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- master
paths-ignore:
# TODO: how to avoid duplicating this list?
- README.md
- 'docs/**'
- 'architecture/**'
- 'managed/**'
- '.gitignore'
pull_request:
branches:
- master
paths-ignore:
# TODO: how to avoid duplicating this list?
- README.md
- 'docs/**'
- 'architecture/**'
- 'managed/**'
- '.gitignore'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
runs-on: ubuntu-20.04
name: ${{ matrix.name }}
# Grab the latest CentOS 7 image from here:
# https://hub.docker.com/r/yugabyteci/yb_build_infra_centos7/tags?page=1&ordering=last_updated
strategy:
fail-fast: false
matrix:
include:
- name: "GCC 5, debug, Linuxbrew, CentOS 7"
os: ubuntu-20.04
yb_build_args: debug
- name: "GCC 5, release, Linuxbrew, CentOS 7"
os: ubuntu-20.04
yb_build_args: release
- name: "Clang 11, debug, CentOS 7"
os: ubuntu-20.04
yb_build_args: --clang11 debug
- name: "Clang 11, release, CentOS 7"
os: ubuntu-20.04
yb_build_args: --clang11 release
if: >
(github.event_name == 'push' &&
!contains(github.event.head_commit.message, 'skip ci') &&
!contains(github.event.head_commit.message, 'ci skip')) ||
github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v2
- name: Build YugabyteDB
run: |
echo "OSTYPE (outside Docker): $OSTYPE"
echo "Build name: ${{ matrix.name }}"
echo "Docker image: ${{ matrix.docker_image }}"
if [[ $OSTYPE == linux* ]]; then
build_dir_in_container=/opt/yb-build/yugabyte-db
docker run \
-i \
"-w=$build_dir_in_container" \
--mount type=bind,source="$PWD",target="$build_dir_in_container" \
"yugabyteci/yb_build_infra_centos7:v2021-03-26T05_02_29" \
bash -c '
set -euo pipefail -x
echo "OSTYPE (inside Docker): $OSTYPE"
echo "PATH: $PATH"
export PATH=/usr/local/bin:$PATH
( set -x; ls -l /usr/local/bin )
set +e
( set -x; which ninja )
( set -x; which cmake )
set -e
chown -R yugabyteci .
sudo -u yugabyteci bash -c "
set -euo pipefail
export PATH=/usr/local/bin:\$PATH
df -H /
echo ::group::Building YugabyteDB
./yb_build.sh release \
--download-thirdparty \
--ninja \
--shellcheck \
${{ matrix.yb_build_args }}
echo ::endgroup::
df -H /
"
'
elif [[ $OSTYPE == darwin* ]]; then
system_profiler SPSoftwareDataType
sw_vers
./yb_build.sh release --shellcheck
fi