-
Notifications
You must be signed in to change notification settings - Fork 0
197 lines (170 loc) · 8.22 KB
/
linux.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# This file is part of BOINC.
# https://boinc.berkeley.edu
# Copyright (C) 2023 University of California
#
# BOINC is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
#
# BOINC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with BOINC. If not, see <http://www.gnu.org/licenses/>.
name: Linux
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 0 * * *'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_KEY }}
AWS_DEFAULT_REGION: us-west-2
jobs:
build-clang:
name: ${{ matrix.app }}-${{ matrix.configuration }}-build
runs-on: ubuntu-latest
container:
image: debian:buster
strategy:
matrix:
app: [boinc-autodock-vina]
configuration: [x64-linux-static, x86-linux-static]
fail-fast: false
steps:
- name: Install dependencies
run: |
apt-get -qq update
apt-get install -y clang-11 make build-essential m4 pkg-config autoconf libtool git python3 python3-distutils curl zip unzip tar bison p7zip-full
- name: Install aws cli tool
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
./aws/install
- name: Install cmake
run: |
curl -L https://github.com/Kitware/CMake/releases/download/v3.27.0/cmake-3.27.0-linux-x86_64.sh -o cmake.sh
chmod +x cmake.sh
./cmake.sh --skip-license --prefix=/usr/local
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Fix git configuration
if: success()
run: |
CWD=$(pwd)
echo "Current working directory: $CWD"
git config --global --add safe.directory "$CWD"
- name: Install x86 dependencies
if: ${{ success() && matrix.configuration == 'x86-linux-static' }}
run: |
apt-get -qq update
apt-get install -y gcc-multilib g++-multilib
- name: Check if build is running from origin repo
if: ${{ success() && env.AWS_ACCESS_KEY_ID != 0 && env.AWS_SECRET_ACCESS_KEY != 0 }}
run: |
echo "VCPKG_BINARY_SOURCES=clear;x-aws,s3://vcpkg.cache.boinc-apps/,readwrite" >> $GITHUB_ENV
- name: Check if build is running from fork
if: ${{ success() && (env.AWS_ACCESS_KEY_ID == 0 || env.AWS_SECRET_ACCESS_KEY == 0) }}
run: |
echo "VCPKG_BINARY_SOURCES=clear;x-aws-config,no-sign-request;x-aws,s3://vcpkg.cache.boinc-apps/,read" >> $GITHUB_ENV
- name: Build
if: ${{ success() }}
run: |
python3 build.py -nt -ts=ci -t=${{ matrix.configuration }} ${{ matrix.app }}
- name: Test x86 and x64
if: ${{ success() && (matrix.configuration == 'x86-linux-static' || matrix.configuration == 'x64-linux-static') }}
run: |
python3 build.py -nb -ts=ci -t=${{ matrix.configuration }} ${{ matrix.app }}
- name: Upload boinc-autodock-vina artifacts
if: ${{ success() && matrix.app == 'boinc-autodock-vina' }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.app }}-${{ matrix.configuration }}-${{ github.event.pull_request.head.sha }}
path: |
build/${{ matrix.app }}/${{ matrix.configuration }}/boinc-autodock-vina
build/${{ matrix.app }}/${{ matrix.configuration }}/config-validator
build/${{ matrix.app }}/${{ matrix.configuration }}/work-generator
build-gcc:
name: ${{ matrix.app }}-${{ matrix.configuration }}-build
runs-on: ubuntu-latest
strategy:
matrix:
app: [boinc-autodock-vina]
configuration: [arm-linux-static, armneon-linux-static, arm64-linux-static, coverage-report]
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Install arm dependencies
if: ${{ success() && (matrix.configuration == 'arm-linux-static' || matrix.configuration == 'armneon-linux-static') }}
run: |
sudo apt-get -qq update
sudo apt-get install -y gcc-9-arm-linux-gnueabihf g++-9-arm-linux-gnueabihf binutils-arm-linux-gnueabihf qemu-user-static
- name: Fix arm gcc/g++ 9 installation
if: ${{ success() && (matrix.configuration == 'arm-linux-static' || matrix.configuration == 'armneon-linux-static') }}
run: |
sudo update-alternatives --install /usr/bin/arm-linux-gnueabihf-gcc arm-linux-gnueabihf-gcc /usr/bin/arm-linux-gnueabihf-gcc-9 99
sudo update-alternatives --set arm-linux-gnueabihf-gcc /usr/bin/arm-linux-gnueabihf-gcc-9
sudo update-alternatives --install /usr/bin/arm-linux-gnueabihf-g++ arm-linux-gnueabihf-g++ /usr/bin/arm-linux-gnueabihf-g++-9 99
sudo update-alternatives --set arm-linux-gnueabihf-g++ /usr/bin/arm-linux-gnueabihf-g++-9
- name: Install arm64 dependencies
if: ${{ success() && matrix.configuration == 'arm64-linux-static' }}
run: |
sudo apt-get -qq update
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu qemu-user-static
- name: Check if build is running from origin repo
if: ${{ success() && env.AWS_ACCESS_KEY_ID != 0 && env.AWS_SECRET_ACCESS_KEY != 0 }}
run: |
echo "VCPKG_BINARY_SOURCES=clear;x-aws,s3://vcpkg.cache.boinc-apps/,readwrite" >> $GITHUB_ENV
- name: Check if build is running from fork
if: ${{ success() && (env.AWS_ACCESS_KEY_ID == 0 || env.AWS_SECRET_ACCESS_KEY == 0) }}
run: |
echo "VCPKG_BINARY_SOURCES=clear;x-aws-config,no-sign-request;x-aws,s3://vcpkg.cache.boinc-apps/,read" >> $GITHUB_ENV
- name: Build
if: ${{ success() && matrix.configuration != 'coverage-report' }}
run: |
python3 build.py -nt -ts=ci -t=${{ matrix.configuration }} ${{ matrix.app }}
- name: Build for Coverage Report
if: ${{ success() && matrix.configuration == 'coverage-report' }}
run: |
python3 build.py -nt -cr -ts=ci -t=x64-linux-static ${{ matrix.app }}
- name: Test arm and armneon
if: ${{ success() && (matrix.configuration == 'arm-linux-static' || matrix.configuration == 'armneon-linux-static') }}
run: |
python3 build.py -nb -ts=ci -t=${{ matrix.configuration }} -qemu=qemu-arm-static ${{ matrix.app }}
- name: Test arm64
if: ${{ success() && matrix.configuration == 'arm64-linux-static' }}
run: |
python3 build.py -nb -ts=ci -t=${{ matrix.configuration }} -qemu=qemu-aarch64-static ${{ matrix.app }}
- name: Coverage Report
if: ${{ success() && matrix.configuration == 'coverage-report' }}
run: |
python3 build.py -nb -cr -ts=ci -t=x64-linux-static ${{ matrix.app }}
- name: Upload boinc-autodock-vina artifacts
if: ${{ success() && matrix.app == 'boinc-autodock-vina' && matrix.configuration != 'coverage-report' }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.app }}-${{ matrix.configuration }}-${{ github.event.pull_request.head.sha }}
path: |
build/${{ matrix.app }}/${{ matrix.configuration }}/boinc-autodock-vina
build/${{ matrix.app }}/${{ matrix.configuration }}/config-validator
build/${{ matrix.app }}/${{ matrix.configuration }}/work-generator
- name: Run GCov
if: ${{ success() && matrix.configuration == 'coverage-report' }}
run: bash -c "find . -type f -name '*.gcno' -exec gcov -pb {} +" || true
- name: Upload coverage report
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: ${{ success() && matrix.configuration == 'coverage-report' }}
with:
fail_ci_if_error: true
verbose: false