-
Notifications
You must be signed in to change notification settings - Fork 3
146 lines (131 loc) · 5.4 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Build Compatibility
# Only run for pull requests as we care contribution to the master
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
linux-gcc:
runs-on: ubuntu-latest
# Branch on different OS and settings
strategy:
fail-fast: false
matrix:
config:
- name: "Build Compatibility: GCC-11 (Ubuntu 18.04)"
cc: gcc-11
cxx: g++-11
# Define the steps to run the build job
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
steps:
- name: Runner workspace path
run: |
echo "Cleaning up previous run"
rm -rf "${{ github.workspace }}"
mkdir -p "${{ github.workspace }}"
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 0
submodules: true
- name: Checkout submodule
run: |
make checkout
- name: Install dependencies
run: |
sudo .github/workflows/install_ubuntu_dependencies_build.sh
- name: Build
run: |
make release PRODUCTION_BUILD=1
centos7-gcc:
runs-on: ubuntu-latest
container:
image: centos:7
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
config:
- name: "Build Compatibility: GCC-11 (CentOs)"
cc: gcc-11
cxx: g++-11
# Define the steps to run the build job
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
steps:
- name: Install ssh-agent
run: |
cd /opt && curl -L -o yumvault.tar.gz https://github.com/os-fpga/post_build_artifacts/releases/download/v0.2/yumvaultn.tar.gz && tar xvzf yumvault.tar.gz && ls -l && mv etc/yum.repos.d/Custom.repo /etc/yum.repos.d
yum-config-manager --disable base extras updates
yum update -y
rm -f /etc/yum.repos.d/Custom.repo
yum-config-manager --enable C7.9.2009-extras C7.9.2009-updates C7.9.2009-base
yum install -y openssh-server openssh-clients
yum-config-manager --enable rhel-server-rhscl-7-rpms
yum install -y https://repo.ius.io/ius-release-el7.rpm
yum install -y centos-release-scl
sed -i 's|^mirrorlist=|#mirrorlist=|' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
sed -i 's|^#baseurl=http://mirror.centos.org/centos/7/sclo/$basearch/rh/|baseurl=http://vault.centos.org/7.9.2009/sclo/$basearch/rh/|' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
sed -i 's|^mirrorlist=|#mirrorlist=|' /etc/yum.repos.d/CentOS-SCLo-scl.repo
sed -i 's|^# baseurl=http://mirror.centos.org/centos/7/sclo/$basearch/sclo/|baseurl=http://vault.centos.org/7.9.2009/sclo/$basearch/sclo/|' /etc/yum.repos.d/CentOS-SCLo-scl.repo
yum install -y devtoolset-11
yum install -y devtoolset-11-toolchain
yum remove -y git*
yum install -y https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
yum install -y git
- name: Checkout repo
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git init $GITHUB_WORKSPACE
git remote add origin https://github.com/$GITHUB_REPOSITORY
git remote -v
git config --local gc.auto 0
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
git -c protocol.version=2 fetch --prune --progress --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/* +${{ github.sha }}:refs/remotes/pull/${{ github.event.pull_request.number }}/merge
git checkout --progress --force refs/remotes/pull/${{ github.event.pull_request.number }}/merge
else
git -c protocol.version=2 fetch --prune --progress --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/*
git checkout origin/$GITHUB_REF_NAME
fi
git log -1 --format='%H'
- name: Install dependencies
run: |
bash .github/workflows/install_centos_dependencies_build.sh
- name: Show shell configuration
run: |
env
source /opt/rh/devtoolset-11/enable
which gcc
which g++
- name: Configure shell
run: |
source /opt/rh/devtoolset-11/enable
echo 'CC=/opt/rh/devtoolset-11/root/usr/bin/gcc' >> $GITHUB_ENV
echo 'CXX=/opt/rh/devtoolset-11/root/usr/bin/g++' >> $GITHUB_ENV
echo 'PATH=/usr/local/Qt-5.15.0/bin:/usr/lib/ccache:'"$PATH" >> $GITHUB_ENV
echo 'PREFIX=/tmp/raptor_gui-install' >> $GITHUB_ENV
echo "$PREFIX" >> $GITHUB_PATH
echo "ADDITIONAL_CMAKE_OPTIONS='-DMY_CXX_WARNING_FLAGS="-W -Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -Werror -UNDEBUG"'" >> $GITHUB_ENV
echo 'RULE_MESSAGES=off' >> $GITHUB_ENV
echo 'LC_ALL=en_US.utf-8' >> $GITHUB_ENV
echo 'LANG=en_US.utf-8' >> $GITHUB_ENV
- name: Configure git
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Checkout submodule
run: |
make checkout
- name: Build
run: |
make release PRODUCTION_BUILD=1