-
Notifications
You must be signed in to change notification settings - Fork 0
462 lines (401 loc) · 16.5 KB
/
Pipeline.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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
name: Pipeline
on:
push:
workflow_dispatch:
schedule:
# Every Friday at 22:00 - rerun pipeline to check for dependency-based issues
- cron: '0 22 * * 5'
jobs:
UnitTestingParams:
uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev
with:
name: pyEDAA.CLITool
CompileUbuntu:
name: Compile GHDL on Ubuntu 2024.04 (LTS)
runs-on: "ubuntu-24.04"
strategy:
fail-fast: false
matrix:
backend: [mcode, llvm]
defaults:
run:
shell: bash
steps:
- name: ⏬ Checkout repository
uses: actions/checkout@v4
with:
repository: ghdl/ghdl
- name: 🔧 Install dependencies
run: |
[ '${{ matrix.backend }}' == 'llvm' ] && LLVM_ARGS='llvm clang' || unset LLVM_ARGS
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc g++ gnat $LLVM_ARGS
- name: Prepare build environemnt
run: |
mkdir -p build/${{ matrix.backend }}
./configure --help
- name: ⚙ Configure
run: |
cd build/${{ matrix.backend }}
[ '${{ matrix.backend }}' == 'llvm' ] && LLVM_ARGS='--with-llvm-config' || unset LLVM_ARGS
NPROC=$(nproc)
GNATMAKE="gnatmake -j$NPROC" \
MAKE="make -j$NPROC" \
../../configure --prefix=/opt/ghdl-${{ matrix.backend }} $LLVM_ARGS
- name: 🔨 Make
run: |
cd build/${{ matrix.backend }}
make
- name: 📋 Install
run: |
cd build/${{ matrix.backend }}
sudo make install
- name: 📤 Upload 'GHDL' artifact
uses: actions/upload-artifact@v4
with:
name: ghdl-ubuntu-24.04-x86_64-${{ matrix.backend }}
path: /opt/ghdl-${{ matrix.backend }}/
if-no-files-found: error
retention-days: 1
CompileMacOS:
name: Compile GHDL on macOS 14.0 (aarch64)
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
backend: [llvm] # mcode
env:
GNAT_ARCH: "aarch64"
GNAT_VERSION: "14.1.0-3"
defaults:
run:
shell: bash
steps:
- name: ⏬ Checkout repository
uses: actions/checkout@v4
with:
repository: ghdl/ghdl
- name: Install dependencies
run: |
brew install llvm
echo "LLVM_BINARY_PATH=$(brew --prefix llvm)/bin" >> $GITHUB_ENV
- name: Install GNAT
run: |
GNAT_NAME="gnat-${{ env.GNAT_ARCH }}-darwin-${{ env.GNAT_VERSION }}"
GNAT_URL="https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-${{ env.GNAT_VERSION }}/${GNAT_NAME}.tar.gz"
echo "Downloading GNAT ${{ env.GNAT_VERSION }} (${{ env.GNAT_ARCH }}) from '$GNAT_URL'"
wget -q --show-progress --progress=bar:force:noscroll -O GNAT.tar.gz "$GNAT_URL"
test $? -ne 0 && echo -e "ERROR: Downloading '$GNAT_URL'" && exit 1
ls -lAh
tar -zxf GNAT.tar.gz && rm GNAT.tar.gz
test $? -ne 0 && echo -e "ERROR: Extracting 'GNAT.tar.gz'" && exit 1
mv ${GNAT_NAME} gnat
echo "ls gnat"
ls -lAh gnat
echo "ls gnat/bin"
ls -lAh gnat/bin
./gnat/bin/gnatls -v
echo "PWD: $(pwd)"
ls -lAh $(pwd)/gnat
ls -lAh $(pwd)/gnat/bin
echo "GNAT_BINARY_PATH=$(pwd)/gnat/bin" >> $GITHUB_ENV
- name: Prepare build environemnt
run: |
mkdir -p build/${{ matrix.backend }}
echo $PATH
echo "PATH=$GNAT_BINARY_PATH:$LLVM_BINARY_PATH:$PATH" >> $GITHUB_ENV
- name: Check build environemnt
run: |
echo $PATH
ls -lAh $(pwd)
ls -lAh /Users/runner/work/pyEDAA.CLITool/pyEDAA.CLITool/gnat/bin
echo "which gnat: $(which gnat) ($($(which gnat) --version))"
echo "which gnatmake: $(which gnatmake) ($($(which gnatmake) --version))"
echo "which llvm-config: $(which llvm-config) ($($(which llvm-config) --version))"
- name: ⚙ Configure
run: |
cd build/${{ matrix.backend }}
[ '${{ matrix.backend }}' == 'llvm' ] && LLVM_ARGS='--with-llvm-config' || unset LLVM_ARGS
# Use static libs (including libzstd) and dead-strip (to avoid libz3)
libzstd=$(brew --prefix zstd)/lib/libzstd.a
export LLVM_LDFLAGS="$(llvm-config --link-static --libfiles --system-libs | sed -e s@-lzstd@$libzstd@) -Wl,-dead_strip,-dead_strip_dylibs"
echo $LLVM_LDFLAGS
# Use classic ld and not lld (which simply crashes)
NPROC=$(sysctl -n hw.logicalcpu)
GNATMAKE="gnatmake -j$NPROC" \
MAKE="make -j$NPROC" \
LDFLAGS=-Wl,-ld_classic \
../../configure --prefix=/opt/ghdl-${{ matrix.backend }} $LLVM_ARGS
- name: 🔨 Make
run: |
cd build/${{ matrix.backend }}
make
- name: 📋 Install
run: |
cd build/${{ matrix.backend }}
sudo make install
- name: 📤 Upload 'GHDL' artifact
uses: actions/upload-artifact@v4
with:
name: ghdl-macos-14.0-aarch64-${{ matrix.backend }}
path: /opt/ghdl-${{ matrix.backend }}/
if-no-files-found: error
retention-days: 1
CompileWindows:
name: Compile GHDL on Windows Server
runs-on: windows-latest
env:
msys2_packages: "make"
common_packages: "gcc:p gcc-ada:p diffutils:p"
mcode_packages: ""
llvm_packages: "llvm:p clang:p"
strategy:
fail-fast: false
matrix:
runtime: [mingw64, ucrt64]
backend: [mcode, llvm]
defaults:
run:
shell: "msys2 {0}"
steps:
- name: ⏬ Checkout repository
uses: actions/checkout@v4
with:
repository: ghdl/ghdl
- name: '🟦 Setup MSYS2 for ${{ matrix.runtime }}'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.runtime }}
update: true
install: ${{ env.msys2_packages }}
pacboy: "${{ env.common_packages }} ${{ env.mcode_packages }} ${{ env.llvm_packages }}"
- name: Check build environemnt
run: |
echo "which gnat: $(which gnat) ($($(which gnat) --version))"
echo "which gnatmake: $(which gnatmake) ($($(which gnatmake) --version))"
echo "which llvm-config: $(which llvm-config) ($($(which llvm-config) --version))"
- name: Prepare build environemnt
run: |
mkdir -p build/${{ matrix.backend }}
mkdir -p install
- name: ⚙ Configure
run: |
cd build/${{ matrix.backend }}
[ '${{ matrix.backend }}' == 'llvm' ] && LLVM_ARGS='--with-llvm-config' || unset LLVM_ARGS
NPROC=$(nproc)
GNATMAKE="gnatmake -j$NPROC" \
MAKE="make -j$NPROC" \
../../configure --prefix=../../install/ghdl-${{ matrix.runtime }}-${{ matrix.backend }} $LLVM_ARGS
- name: 🔨 Make
run: |
cd build/${{ matrix.backend }}
make
- name: 📋 Install
run: |
cd build/${{ matrix.backend }}
make install
- name: Debug
run: |
ls -lAh ./install
ls -lAh ./install/ghdl-${{ matrix.runtime }}-${{ matrix.backend }}
ls -lAh ./install/ghdl-${{ matrix.runtime }}-${{ matrix.backend }}/bin
- name: 📤 Upload 'GHDL' artifact
uses: actions/upload-artifact@v4
with:
name: ghdl-windows-${{ matrix.runtime }}-${{ matrix.backend }}
path: ./install/ghdl-${{ matrix.runtime }}-${{ matrix.backend }}/
if-no-files-found: error
retention-days: 1
UnitTesting:
uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev
needs:
- UnitTestingParams
# - CompileUbuntu
- CompileMacOS
- CompileWindows
with:
jobs: ${{ needs.UnitTestingParams.outputs.python_jobs }}
apt: ghdl-mcode
brew: --cask ghdl
pacboy: ghdl
ubuntu_before_script: |
which ghdl
ghdl version
echo "GHDL_PREFIX=/usr/lib/x86_64-linux-gnu/ >> $GITHUB_ENV"
echo "GHDL_PREFIX=/usr/lib/x86_64-linux-gnu/" >> $GITHUB_ENV
macos_arm_before_script: |
which ghdl
ghdl version
echo $(brew --prefix llvm@15)
export DYLD_LIBRARY_PATH=$(brew --prefix llvm@15)/lib
echo -$DYLD_LIBRARY_PATH-
echo "DYLD_LIBRARY_PATH=$(brew --prefix llvm@15)/lib" >> $GITHUB_ENV
echo "GHDL_PREFIX=$(realpath $(dirname $(which ghdl))/../lib/ghdl) >> $GITHUB_ENV"
echo "GHDL_PREFIX=$(realpath $(dirname $(which ghdl))/../lib/ghdl)" >> $GITHUB_ENV
ls -lAh "$(realpath $(dirname $(which ghdl))/../lib)"
echo "----"
ls $(brew --prefix llvm@15)/lib
mingw64_before_script: |
which ghdl
ghdl version
echo "GHDL_PREFIX=$(realpath $(dirname $(which ghdl))/../lib/ghdl) >> $GITHUB_ENV"
echo "GHDL_PREFIX=$(realpath $(dirname $(which ghdl))/../lib/ghdl)" >> $GITHUB_ENV
# ls -lAh "$(realpath $(dirname $(which ghdl))/../lib)"
ucrt64_before_script: |
which ghdl
ghdl version
echo "GHDL_PREFIX=$(realpath $(dirname $(which ghdl))/../lib/ghdl) >> $GITHUB_ENV"
echo "GHDL_PREFIX=$(realpath $(dirname $(which ghdl))/../lib/ghdl)" >> $GITHUB_ENV
# ls -lAh "$(realpath $(dirname $(which ghdl))/../lib)"
# ubuntu_before_script: sudo install -m 755 tests/mock/ghdl /usr/local/bin
requirements: "-r tests/unit/requirements.txt"
unittest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}
coverage_sqlite_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}
StaticTypeCheck:
uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@dev
needs:
- UnitTestingParams
with:
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
commands: |
touch pyEDAA/__init__.py
mypy --html-report htmlmypy -p pyEDAA.CLITool
html_report: 'htmlmypy'
html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }}
DocCoverage:
uses: pyTooling/Actions/.github/workflows/CheckDocumentation.yml@dev
needs:
- UnitTestingParams
with:
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
directory: pyEDAA/CLITool
# fail_below: 70
ConfigParams:
uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@dev
needs:
- DocCoverage
Package:
uses: pyTooling/Actions/.github/workflows/Package.yml@dev
needs:
- UnitTestingParams
- UnitTesting
with:
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
PublishCoverageResults:
uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@dev
needs:
- UnitTestingParams
- UnitTesting
with:
coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}
coverage_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
secrets:
codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }}
PublishTestResults:
uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@dev
needs:
- UnitTestingParams
- UnitTesting
with:
additional_merge_args: '"--pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit" --render=tree'
merged_junit_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}
# VerifyDocs:
# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@dev
# needs:
# - UnitTestingParams
# with:
# python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
Documentation:
uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@dev
needs:
- UnitTestingParams
- ConfigParams
- PublishTestResults
- PublishCoverageResults
# - VerifyDocs
with:
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
coverage_report_json_directory: ${{ needs.ConfigParams.outputs.coverage_report_json_directory }}
unittest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}
coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}
html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }}
latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }}
IntermediateCleanUp:
uses: pyTooling/Actions/.github/workflows/IntermediateCleanUp.yml@dev
needs:
- UnitTestingParams
- PublishCoverageResults
- PublishTestResults
- Documentation
with:
sqlite_coverage_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}-
xml_unittest_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}-
PDFDocumentation:
uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@dev
needs:
- UnitTestingParams
- Documentation
with:
document: pyEDAA.CLITool
latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }}
pdf_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }}
PublishToGitHubPages:
uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@dev
needs:
- UnitTestingParams
- Documentation
# - PDFDocumentation
- PublishCoverageResults
- StaticTypeCheck
with:
doc: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }}
# coverage: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
typing: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }}
ReleasePage:
uses: pyTooling/Actions/.github/workflows/Release.yml@dev
if: startsWith(github.ref, 'refs/tags')
needs:
- PublishToGitHubPages
PublishOnPyPI:
uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@dev
if: startsWith(github.ref, 'refs/tags')
needs:
- UnitTestingParams
- ReleasePage
with:
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
requirements: -r dist/requirements.txt
artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
ArtifactCleanUp:
uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@dev
needs:
- UnitTestingParams
- UnitTesting
- StaticTypeCheck
- Documentation
# - PDFDocumentation
- PublishTestResults
- PublishCoverageResults
- PublishToGitHubPages
with:
package: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
remaining: |
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}-*
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_html }}-*
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}-*
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}-*
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}-*
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}-*
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_html }}
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }}
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }}
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }}
# ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }}