-
Notifications
You must be signed in to change notification settings - Fork 0
291 lines (268 loc) · 9.92 KB
/
cron.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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
schedule:
- cron: '0 10 * * *'
push:
branches:
- '**'
workflow_dispatch: {}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
generate-matrix:
name: Generate Job Matrix
runs-on: ubuntu-20.04
outputs:
matrixLinux: ${{ steps.set-matrix.outputs.matrixLinux }}
matrixBSD: ${{ steps.set-matrix.outputs.matrixBSD }}
steps:
- uses: actions/checkout@v4
- name: Checkout CCI
uses: actions/checkout@v4
with:
repository: conan-io/conan-center-index
path: CCI
- uses: actions/setup-python@v5
with:
python-version: "3.8"
cache: 'pip' # caching pip dependencies
- run: python3 -m pip install -r requirements.txt
- name: Generate Job Matrix
id: set-matrix
run: |
python3 main.py
MATRIXLINUX=$(cat matrixLinux.yml)
echo "${MATRIXLINUX}"
echo "matrixLinux=${MATRIXLINUX}" >> $GITHUB_OUTPUT
MATRIXBSD=$(cat matrixBSD.yml)
echo "${MATRIXBSD}"
echo "matrixBSD=${MATRIXBSD}" >> $GITHUB_OUTPUT
FreeBSD:
if: ${{ true }}
needs: generate-matrix
strategy:
fail-fast: false
matrix: ${{fromJson(needs.generate-matrix.outputs.matrixBSD)}}
runs-on: ubuntu-22.04
env:
CC: clang
CXX: clang++
CONAN_SYSREQUIRES_MODE: enabled
steps:
- name: Checkout CCI
uses: actions/checkout@v4
with:
repository: ${{ matrix.repo }}
ref: ${{ matrix.ref }}
path: CCI
- name: run
id: test
uses: vmactions/freebsd-vm@v1
with:
envs: 'CONAN_MAKE_PROGRAM CC CXX CONAN_SYSREQUIRES_MODE'
usesh: true
prepare: pkg install -y cmake py39-pip py39-sqlite3 sudo pkgconf
run: |
python3.9 -m pip install conan distro
code=0
set +o pipefail
conan profile detect
conan create CCI/recipes/${{ matrix.package }}/${{ matrix.folder }} --version system -c tools.system.package_manager:mode=install || code=$?
filename=artifact_${{ github.job }}_${{ strategy.job-index }}.yml
echo package: ${{ matrix.package }} >> ${filename}
echo pr: ${{ matrix.pr }} >> ${filename}
echo distro: FreeBSD >> ${filename}
echo res: $code >> ${filename}
if [ $code == 6 ]
then
code=0
fi
exit "$code"
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: my-artifact-${{ github.job }}-${{ strategy.job-index }}
path: artifact_*.yml
Linux:
if: ${{ true }}
needs: generate-matrix
strategy:
fail-fast: false
matrix: ${{fromJson(needs.generate-matrix.outputs.matrixLinux)}}
runs-on: ubuntu-20.04
container: ${{ matrix.distro }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Install Python
env:
DEBIAN_FRONTEND: noninteractive
run: |
case ${{ matrix.distro }} in
opensuse*)
zypper --non-interactive install python3 python3-pipx python3-setuptools python3-wheel tar gzip pkg-config gcc-c++ make
;;
debian*)
apt-get update && apt-get -qq install -y --no-install-recommends pipx python3-setuptools python3-venv pkg-config g++ make
;;
ubuntu*)
apt-get update && apt-get -qq install -y --no-install-recommends pipx python3-setuptools python3-venv pkg-config g++ make;;
quay.io/centos/centos:stream8)
yum -y install dnf-plugins-core && yum config-manager --set-enabled powertools && yum install -y python3 python3-pip pkgconf-pkg-config gcc-c++ make
python3 -m pip install --user pipx
;;
quay.io/centos/centos:stream9)
yum -y install dnf-plugins-core && yum config-manager --set-enabled crb && yum install -y python3 pipx pkgconf-pkg-config gcc-c++ make;;
almalinux:8*)
yum -y install dnf-plugins-core && yum config-manager --set-enabled powertools && yum install -y epel-release && yum install -y python3 python3-wheel python3-pip pkgconf-pkg-config gcc-c++ make
python3 -m pip install --user pipx
;;
almalinux:9*)
yum -y install dnf-plugins-core && yum config-manager --set-enabled crb && yum install -y epel-release && yum install -y python3 python3-wheel pipx pkgconf-pkg-config gcc-c++ make;;
archlinux*)
pacman -Syu --noconfirm python-pipx python-platformdirs gcc pkgconf gcc make;;
fedora*)
dnf -y install python3 python3-wheel pipx pkgconf-pkg-config gcc-c++ make;;
esac
- name: Checkout CCI
uses: actions/checkout@v4
with:
repository: ${{ matrix.repo }}
ref: ${{ matrix.ref }}
path: CCI
- name: run
shell: bash
env:
CONAN_SYSREQUIRES_MODE: enabled
CONAN_SYSREQUIRES_SUDO: 0
DEBIAN_FRONTEND: noninteractive
run: |
export PATH=~/.local/bin:$PATH
pipx install conan
pipx install distro
pipx install cmake
conan profile detect
# conan config install ${GITHUB_SERVER_URL}/${{ github.repository }}/archive/${{ github.sha }}.zip -sf=system-packages-checks-${{ github.sha }}/config
# conan install --tool-requires cmake/3.25.2@ -g VirtualBuildEnv -s:b compiler=gcc -s:b compiler.version=11 -s:b compiler.libcxx=libstdc++11
# source ./conanbuild.sh
code=0
set +o pipefail
conan create CCI/recipes/${{ matrix.package }}/${{ matrix.folder }} --version system -c tools.system.package_manager:mode=install || code=$?
filename=artifact_${{ github.job }}_${{ strategy.job-index }}.yml
echo package: ${{ matrix.package }} >> ${filename}
echo pr: ${{ matrix.pr }} >> ${filename}
echo distro: "${{ matrix.distro }}" >> ${filename}
echo res: $code >> ${filename}
if [ $code == 6 ]
then
code=0
fi
exit "$code"
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: my-artifact-${{ github.job }}-${{ strategy.job-index }}
path: artifact_*.yml
Raspberry:
if: ${{ true }}
needs: generate-matrix
strategy:
fail-fast: false
matrix: ${{fromJson(needs.generate-matrix.outputs.matrixBSD)}}
runs-on: ubuntu-latest
steps:
- name: Checkout CCI
uses: actions/checkout@v4
with:
repository: ${{ matrix.repo }}
ref: ${{ matrix.ref }}
path: CCI
- name: run
id: test
uses: pguyot/arm-runner-action@main
with:
image_additional_mb: 1024
shell: bash
copy_artifact_path: "artifact_*.yml"
commands: |
export CONAN_SYSREQUIRES_MODE=enabled
export CONAN_SYSREQUIRES_SUDO=0
export DEBIAN_FRONTEND=noninteractive
export PIP_ONLY_BINARY=cmake # workaround scikit-build/cmake-python-distributions#192
apt-get update && apt-get -qq install -y --no-install-recommends pipx python3-setuptools python3-venv pkg-config g++ make
export PATH=/opt/pipx_bin:$PATH
pipx install conan
pipx install distro
pipx install cmake --pip-args "-Iv cmake==3.22.0"
code=0
set +o pipefail
conan profile detect
conan create CCI/recipes/${{ matrix.package }}/${{ matrix.folder }} --version system -c tools.system.package_manager:mode=install || code=$?
filename=artifact_${{ github.job }}_${{ strategy.job-index }}.yml
echo package: ${{ matrix.package }} >> ${filename}
echo pr: ${{ matrix.pr }} >> ${filename}
echo distro: Raspberry >> ${filename}
echo res: $code >> ${filename}
if [ $code == 6 ]
then
code=0
fi
exit "$code"
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: my-artifact-${{ github.job }}-${{ strategy.job-index }}
path: artifact_*.yml
Gather_Results:
name: Gather results
needs: [FreeBSD, Linux, Raspberry]
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
cache: 'pip' # caching pip dependencies
- run: python3 -m pip install -r requirements.txt
- uses: actions/download-artifact@v4
with:
pattern: my-artifact-*
merge-multiple: true
- name: Generate web page
run: |
pwd
ls -al
python create_report.py
ls -al
ls -al pages
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./pages
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
# Deployment job
deploy:
if: ${{ always() }}
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
actions: read
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: Gather_Results
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4