aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/Test.yml
blob: de4ecb53d6b1e46e5c851bb967034992e4cd08fe (plain)
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
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
name: Test

on:
  push:
  pull_request:
  workflow_dispatch:

env:
  CI: true
  DOCKER_BUILDKIT: 1

jobs:

# Convention for the names:
# lin, osx, win, msys2: build package for the platform
# *-test: test on the platform

#
# Generate and upload doc
#
  gnatdoc:
    name: '📚 gnatdoc'
    runs-on: ubuntu-latest

    steps:
      - name: '🧰 Checkout'
        uses: actions/checkout@v3

      - name: '📚 Run gnatdoc'
        run: |
          docker run --rm -i -v $(pwd):/src -w /src ghdl/debug:base <<'EOF'
          #!/usr/bin/env sh
          ./configure --enable-werror && make && make install
          gnatdoc -P./ghdl
          EOF

      - name: '📤 Upload artifact: gnatdoc'
        uses: actions/upload-artifact@v3
        with:
          name: gnatdoc
          path: gnatdoc

#
# Upload Build The Doc
#
  doc:
    needs: gnatdoc
    name: '📓 Docs'
    runs-on: ubuntu-latest

    steps:

      - name: '🧰 Checkout'
        uses: actions/checkout@v3

      - name: '⛴ Build ghdl/doc'
        run: |
          docker build -t ghdl/doc . -f- <<-EOF
          FROM ghdl/build:doc
          COPY . /opt/ghdl
          RUN cd /opt/ghdl && ./configure --enable-werror && make && make install
          EOF

      - name: '📥 Download artifact: gnatdoc'
        uses: actions/download-artifact@v3
        with:
          name: gnatdoc
          path: public/gnatdoc

      - name: '📓 BuildTheDocs (BTD)'
        uses: buildthedocs/btd@v0
        with:
          token: ${{ github.token }}
          skip-deploy: ${{ github.event_name == 'pull_request' }}

      #- run: nroff -man doc/_build/man/ghdl.1

      - name: '📤 Upload artifact: HTML, LaTeX and man'
        uses: actions/upload-artifact@v3
        with:
          name: doc
          path: |
            doc/_build/html
            doc/_build/latex
            doc/_build/man

#
# pyGHDL Bindings, Formatting and pure wheel
#
  pyGHDL:
    name: '🐍 pyGHDL'
    runs-on: ubuntu-latest

    steps:
      - name: '🧰 Checkout'
        uses: actions/checkout@v3

      - name: '🐍 Setup Python'
        uses: actions/setup-python@v4
        with:
          python-version: '3.10'

      - name: '🔧 Install dependencies'
        run: |
          sudo apt update -qq
          sudo apt install -y gnat
          python -m pip install --disable-pip-version-check black wheel pyTooling

      - name: '🚧 Update Python bindings'
        run: ./scripts/update_py_bindings.sh

      - name: '🚦 Check if Python bindings changed'
        run: |
          git diff --stat
          echo "NOTE: Bindings can be updated by executing ./scripts/update_py_bindings.sh (see previous step)"
          git diff --exit-code

      - name: '🚦 Check if python follows code formatting standards'
        run: python -m black --check pyGHDL

      - name: 🔨 Build Python package (source distribution)
        run: python setup.py sdist

      - name: 🔨 Build Python package (binary distribution - wheel)
        run: python setup.py bdist_wheel

      - name: '📤 Upload artifact: pyGHDL'
        uses: actions/upload-artifact@v3
        with:
          name: pyGHDL
          path: dist/
          if-no-files-found: error

#
# GPL
#

  gpl:
    if: false
    name: '🚧🚦🐧 GPL mcode'
    runs-on: ubuntu-latest

    steps:

      - name: '🧰 Checkout'
        uses: actions/checkout@v3

      - run: TASK=bullseye+mcode ./scripts/ci-run.sh -c --gplcompat

#
# Build for GNU/Linux
#
  lin:
    name: '🚧🚦🐧 Ubuntu ${{ matrix.os }} ${{ matrix.backend }}'
    runs-on: ubuntu-${{ matrix.os }}.04

    strategy:
      fail-fast: false
      matrix:
        include:
          - { os: 20, backend: mcode }
          - { os: 22, backend: mcode }
          - { os: 20, backend: llvm-10 }
          - { os: 22, backend: llvm-14 }
          - { os: 20, backend: gcc-9.3.0 }
          - { os: 22, backend: gcc-11.2.0 }

    steps:
      - name: '🧰 Checkout'
        uses: actions/checkout@v3

      - name: '🛳 Build and test GHDL in containers'
        run: |
          TASK=ubuntu${{ matrix.os }}+${{ matrix.backend }} ./scripts/ci-run.sh -c
          mv ghdl-*-ubuntu${{ matrix.os }}-*.tgz ghdl-gha-ubuntu-${{ matrix.os }}.04-$(echo ${{ matrix.backend }} | sed 's#-.*##g').tgz

      - name: '📤 Upload artifact: package'
        uses: actions/upload-artifact@v3
        with:
          name: ubuntu${{ matrix.os }}-${{ matrix.backend }}
          path: ghdl-gha-ubuntu-*.tgz
          if-no-files-found: error

#
# Build for MacOS
#
  osx:
    name: '🚧🚦🍎 macOS ${{ matrix.os }} ${{ matrix.backend }}'
    runs-on: 'macOS-${{ matrix.os }}'

    strategy:
      fail-fast: false
      matrix:
        os:
        - '11'
#        - '12' # issue1897 fails.  Maybe test 11 build on 12.
        backend:
          - mcode
          - llvm

    steps:
      - name: '🧰 Checkout'
        uses: actions/checkout@v3

      - name: '💾 Cache gnat'
        id: cache-gnat
        uses: actions/cache@v3
        with:
          path: gnat
          key: ${{ runner.os }}-gnat

      # Although we cache this, we let the script run to check if the cache is valid (without conditions)
      - name: '⚙ Dependencies (brew)'
        run: ./scripts/macosx/install-ada.sh

      - name: '🚧 Build and 🚦 Test GHDL'
        run: |
          PATH=$PWD/gnat/bin:$PATH:/usr/local/Cellar/llvm@14/14.0.6/bin/
          ./scripts/ci-run.sh -c
          mv ghdl-*.tgz ghdl-macos-${{ matrix.os }}-${{ matrix.backend }}.tgz
        env:
          TASK: macosx+${{ matrix.backend }}
          GITHUB_OS: ${{ runner.os }}
          MACOSX_DEPLOYMENT_TARGET: '10.14'

      - name: '📤 Upload artifact: package'
        uses: actions/upload-artifact@v3
        with:
          name: macos${{ matrix.os }}-${{ matrix.backend }}
          path: ghdl-macos-${{ matrix.os }}-${{ matrix.backend }}.tgz
          if-no-files-found: error

#
# Pure Windows Build (on MSYS2) - create zip (and also pre-wheel zip)
#
  win:
    name: '🚧${{ matrix.icon }} ${{ matrix.sys }} (pure-build)'
    runs-on: windows-latest

    strategy:
      fail-fast: false
      matrix:
        include:
          - {icon: '🟪', pkg: 'mcode', sys: 'MINGW32', arch: 'i686' }
#          - {icon: '🟦', pkg: 'mcode', sys: 'MINGW64', arch: 'x86_64' } #! simulation with mcode is not yet supported on win64
          - {icon: '🟨', pkg: 'mcode', sys: 'UCRT64', arch: 'ucrt-x86_64'  } #! experimental; simulation with mcode is not yet supported on win64

    env:
      MINGW_ARCH: ${{ matrix.sys }}
    defaults:
      run:
        shell: msys2 {0}

    steps:
      - name: '${{ matrix.icon }} Setup MSYS2'
        uses: msys2/setup-msys2@v2
        with:
          msystem: ${{ matrix.sys }}
          update: true
          install: base-devel git mingw-w64-${{matrix.arch}}-gcc-ada mingw-w64-${{matrix.arch}}-zlib zip
          pacboy: >
            toolchain:p
            python-pip:p

      - name: '⚙ git config'
        run: git config --global core.autocrlf input
        shell: bash

      - name: '🧰 Checkout'
        uses: actions/checkout@v3
        with:
          # The command 'git describe' (used for version) needs the history.
          fetch-depth: 0

      - name: '🚧 Build package'
        run: |
          pip3 install pefile
          mkdir builddir
          cd builddir
          ../configure --prefix='/GHDL' LDFLAGS="-static -Wl,--stack=8388608" --enable-libghdl
          make
          mkdir -p 'GHDL'
          make install DESTDIR=.
          # No need to add dll dependencies for ghdl, as it is compiled
          # with -static
          make python-wheel
          zip pre-wheel-${{matrix.sys}}.zip -r dist-wheel setup-standalone.py
          zip ghdl-${{matrix.sys}}.zip -r GHDL

      - name: '📤 Upload artifact: pre-wheel'
        uses: actions/upload-artifact@v3
        with:
          name: ${{ matrix.sys }}-pre-wheel
          path: |
            builddir/pre-wheel-${{matrix.sys}}.zip

      - name: '📤 Upload artifact: zip pure-win'
        uses: actions/upload-artifact@v3
        with:
          name: ${{ matrix.sys }}-zip-win
          path: |
            builddir/ghdl-${{matrix.sys}}.zip

#
# Create pure-Windows CPython pyGHDL platform wheel (from the pre-wheel zip)
#
  win-wheel:
    name: '🚦🐍${{ matrix.icon }} ${{ matrix.sys }} (pyGHDL-wheel)'
    runs-on: windows-latest

    needs:
      - win

    strategy:
      fail-fast: false
      matrix:
        include:
          - {icon: '🟪', sys: 'MINGW32', pyarch: x86 }
#          - {icon: '🟦', sys: 'MINGW64', pyarch: x64 }
          - {icon: '🟨', sys: 'UCRT64',  pyarch: x64 }

    defaults:
      run:
        shell: pwsh

    steps:
      - name: '🐍 Setup Python'
        uses: actions/setup-python@v4
        with:
          python-version: '3.10'
          architecture: ${{ matrix.pyarch }}

      - name: '📥 Download artifact: package'
        uses: actions/download-artifact@v3
        with:
          path: artifact
          name: ${{ matrix.sys }}-pre-wheel

      - name: '🐍 Build python wheel'
        run: |
          pip3 install wheel
          pip3 install pyTooling
          unzip artifact/pre-wheel-${{ matrix.sys }}.zip
          python3 ./setup-standalone.py bdist_wheel
          dir dist

      - name: '🐍 Sanity check of the python wheel'
        run: |
          pip3 install -v (get-item dist\pyGHDL-*.whl)
          dir -r ${env:Python3_ROOT_DIR}\Lib\site-packages\pyGHDL
          python3 -m pyGHDL.cli.lsp --version
          python3 -m pyGHDL.cli.dom version

      - name: '📤 Upload artifact: wheel'
        uses: actions/upload-artifact@v3
        with:
          name: ${{ matrix.sys }}-wheel
          path: |
            dist/pyGHDL-*.whl

      - name: '${{ matrix.icon }} Setup MSYS2'
        uses: msys2/setup-msys2@v2
        with:
          msystem: ${{ matrix.sys }}
          update: true

#
# Windows Test of standalone zip
#
  win-test:
    name: '🚦🐍🥡${{ matrix.icon }} ${{ matrix.sys }} (test sa)'
    runs-on: windows-latest

    needs:
      - win

    strategy:
      fail-fast: false
      matrix:
        include:
          - {icon: '🟪', sys: 'MINGW32' }
#          - {icon: '🟦', sys: 'MINGW64' } #! simulation with mcode is not yet supported on win64
#          - {icon: '🟨', sys: 'UCRT64' } #! experimental; simulation with mcode is not yet supported on win64

    defaults:
      run:
        shell: pwsh

    steps:
      - name: '📥 Download artifact: package'
        uses: actions/download-artifact@v3
        with:
          path: artifact
          name: ${{ matrix.sys }}-zip-win

      - name: '⚙ Extract package'
        run: |
          dir
          unzip artifact\ghdl-${{matrix.sys}}.zip
          dir

      - name: '🛠 Set envvars'
        run: |
          $GHDL_DIR = (pwd).Path + '\GHDL\bin'
          echo "GHDL=${GHDL_DIR}\ghdl.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
          echo "$GHDL_DIR" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
          dir $GHDL_DIR


      - name: '🛠 Sanity check'
        run: |
          echo "GHDL is ${env:GHDL}"
          dir ${env:GHDL}
          & ${env:GHDL} version
          echo "sha: ${{github.sha}}"
          echo "head_ref: ${{github.head_ref}}"
          echo "ref_name: ${{github.ref_name}}"

      - name: '⚙ git config'
        run: |
           dir
           dir ${env:GHDL}
           git config --global core.autocrlf input

      - name: '🧰 Checkout'
        uses: actions/checkout@v3
        with:
          path: checkout

      - name: '${{ matrix.icon }} Setup MSYS2'
        uses: msys2/setup-msys2@v2
        with:
          msystem: ${{ matrix.sys }}
          update: true
          pacboy: >
            diffutils:p
            gcc:p

      - name: '🚦 Testsuite for ghdl'
        shell: msys2 {0}
        run: |
          set -x
          pwd
          ls -l
          echo "PATH: $PATH"
          echo "GHDL: $GHDL"
          cygghdl="$(cygpath -u $GHDL)"
          echo "cyg GHDL: $cygghdl"
          $cygghdl -v
          GHDL="$cygghdl"
          PATH="$PATH:$(dirname $cygghdl)"
          echo "PATH: $PATH"
          ghdl version
          cd checkout
          ./testsuite/testsuite.sh gna

#
# Windows Test of pyGHDL platform wheel
#
  win-test-wheel:
    name: '🚦🐍🥡${{ matrix.icon }} ${{ matrix.sys }} (test sa py)'
    runs-on: windows-latest

    needs:
      - win-wheel

    strategy:
      fail-fast: false
      matrix:
        include:
          - {icon: '🟪', sys: 'MINGW32', pyarch: x86 }
#          - {icon: '🟦', sys: 'MINGW64', pyarch: x64 }
          - {icon: '🟨', sys: 'UCRT64',  pyarch: x64 }

    defaults:
      run:
        shell: pwsh

    steps:
      - name: '🐍 Setup Python'
        uses: actions/setup-python@v4
        with:
          python-version: '3.10'
          architecture: ${{ matrix.pyarch }}

      - name: '📥 Download artifact: package'
        uses: actions/download-artifact@v3
        with:
          path: artifact
          name: ${{ matrix.sys }}-wheel

      - name: '🐍 Sanity check of the python wheel'
        run: |
          pip3 install -v (get-item artifact\pyGHDL-*.whl)

      - name: '⚙ git config'
        run: |
           dir
           dir ${env:GHDL}
           git config --global core.autocrlf input

      - name: '🧰 Checkout'
        uses: actions/checkout@v3
        with:
          path: checkout

      - name: '🚦 pyunit tests'
        run: |
          pip3 install pytest
          dir checkout
          cd checkout/testsuite
          python3 -m pytest pyunit

#
# Windows MSYS2 Build
#
  msys2:
    name: '🚧${{ matrix.icon }} ${{ matrix.sys }} ${{ matrix.pkg }} (build)'
    runs-on: windows-latest

    strategy:
      fail-fast: false
      matrix:
        include:
#          - {icon: '🟪', pkg: 'llvm',  sys: 'MINGW32' } ! not yet functional
          - {icon: '🟦', pkg: 'llvm',  sys: 'MINGW64' }
#          - {icon: '🟨', pkg: 'llvm',  sys: 'UCRT64'  } #! experimental
          - {icon: '🟪', pkg: 'mcode', sys: 'MINGW32' }
#          - {icon: '🟦', pkg: 'mcode', sys: 'MINGW64' } #! simulation with mcode is not yet supported on win64
          - {icon: '🟨', pkg: 'mcode', sys: 'UCRT64'  } #! experimental; simulation with mcode is not yet supported on win64

    env:
      MINGW_ARCH: ${{ matrix.sys }}
    defaults:
      run:
        shell: msys2 {0}

    steps:
      - name: '${{ matrix.icon }} Setup MSYS2'
        uses: msys2/setup-msys2@v2
        with:
          msystem: ${{ matrix.sys }}
          update: true
          install: base-devel git
          pacboy: toolchain:p

      - name: '⚙ git config'
        run: git config --global core.autocrlf input
        shell: bash

      - name: '🧰 Checkout'
        uses: actions/checkout@v3
        with:
          # The command 'git describe' (used for version) needs the history.
          fetch-depth: 0

      - name: '🚧 Build package'
        run: |
          cd scripts/msys2-${{ matrix.pkg }}
          makepkg-mingw --noconfirm --noprogressbar -sCLf
          for item in src pkg; do
            tar czf msys2-${{ matrix.pkg }}."$item".tar.gz "$item"
          done

      - name: '📤 Upload artifact: builddir'
        uses: actions/upload-artifact@v3
        with:
          name: ${{ matrix.sys }}-${{ matrix.pkg }}-builddir
          path: |
            scripts/msys2-${{ matrix.pkg }}/msys2-${{ matrix.pkg }}.src.tar.gz
            scripts/msys2-${{ matrix.pkg }}/msys2-${{ matrix.pkg }}.pkg.tar.gz

      - name: '📤 Upload artifact: package'
        uses: actions/upload-artifact@v3
        with:
          name: ${{ matrix.sys }}-${{ matrix.pkg }}
          path: scripts/msys2-${{ matrix.pkg }}/mingw-*ghdl*.pkg.tar.zst
          if-no-files-found: error

#
# Windows MSYS2 Test
#
  msys2-test:
    name: '🚦${{ matrix.sys.icon }} ${{ matrix.sys.sys }} ${{ matrix.sys.pkg }} ${{ matrix.suite }}'
    runs-on: windows-latest

    needs:
      - msys2

    strategy:
      fail-fast: false
      matrix:
        sys:
#          - {icon: '🟪', pkg: 'llvm',  sys: 'MINGW32' } ! not yet functional
#          - {icon: '🟦', pkg: 'llvm',  sys: 'MINGW64' }
#          - {icon: '🟨', pkg: 'llvm',  sys: 'UCRT64'  } #! experimental
          - {icon: '🟪', pkg: 'mcode', sys: 'MINGW32' }
#          - {icon: '🟦', pkg: 'mcode', sys: 'MINGW64' } ! simulation with mcode is not yet supported on win64
#          - {icon: '🟨', pkg: 'mcode', sys: 'UCRT64'  } ! experimental; simulation with mcode is not yet supported on win64

        suite:
          - 'sanity pyunit vpi vhpi'
          - 'gna'
          - 'vests'
          - 'synth'

    defaults:
      run:
        shell: msys2 {0}

    steps:
      - name: '${{ matrix.sys.icon }} Setup MSYS2'
        uses: msys2/setup-msys2@v2
        with:
          msystem: ${{ matrix.sys.sys }}
          update: true
          pacboy: >
            diffutils:p
            gcc:p
            python-pip:p
            python-setuptools:p

      - name: '⚙ git config'
        run: git config --global core.autocrlf input
        shell: bash

      - name: '🧰 Checkout'
        uses: actions/checkout@v3

      - name: '📥 Download artifact: package'
        uses: actions/download-artifact@v3
        with:
          path: artifact
          name: ${{ matrix.sys.sys }}-${{ matrix.sys.pkg }}

      - name: '🛠 Install package and 🐍 Python dependencies'
        run: |
          pacman --noconfirm -U artifact/mingw-w64-*-ghdl-${{ matrix.sys.pkg }}-*.zst
          pip3 install -r testsuite/requirements.txt

      - name: '🚦 Test package'
        run: GHDL=ghdl ./testsuite/testsuite.sh ${{ matrix.suite }}

#
# Release
#

  Release:
    name: '📦 Release'
    runs-on: ubuntu-latest

    needs:
      - doc
      - lin
      - osx
      - win
      - win-wheel
      - win-test
      - msys2-test

    if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/'))

    steps:

      - name: '📥 Download artifacts'
        if: "!contains(github.ref, 'refs/tags/')"
        uses: actions/download-artifact@v3
        with:
          path: artifacts

      # Do not upload assets to tagged releases
      - name: Set list of files for uploading
        id: files
        shell: python
        run: |
          print('None'
              if '${{ github.ref }}'.startswith('refs/tags/')
              else'::set-output name=list::**/*.zst **/*.tgz **/ghdl-*.zip **/man/ghdl.1'
          )

      # Tagged: create a pre-release or a release (semver)
      # Untagged: update the assets of pre-release 'nightly'
      - uses: pyTooling/Actions/releaser@r0
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          tag: 'nightly'
          files: ${{ steps.files.outputs.list }}

      - name: '🔔 Trigger ghdl/docker'
        run: |
          curl -X POST https://api.github.com/repos/ghdl/docker/dispatches \
          -H 'Content-Type: application/json' \
          -H 'Accept: application/vnd.github.everest-preview+json' \
          -H "Authorization: token ${{ secrets.GHDL_BOT }}" \
          --data '{"event_type": "ghdl"}'

#
# pyGHDL Coverage (MINGW64)
#

  coverage:
    name: '📈 Coverage'
    runs-on: windows-latest

    needs:
      - msys2

    defaults:
      run:
        shell: msys2 {0}

    steps:

      - name: '🟪 Setup MSYS2'
        uses: msys2/setup-msys2@v2
        with:
          msystem: MINGW64
          update: true
          pacboy: >
            python-pip:p
            python-setuptools:p

      - name: '⚙ git config'
        run: git config --global core.autocrlf input
        shell: bash

      - name: '🧰 Checkout'
        uses: actions/checkout@v3

      - name: '📥 Download artifact: package'
        uses: actions/download-artifact@v3
        with:
          path: artifact
          name: MINGW64-llvm

      - name: '🛠 Install package and 🐍 Python dependencies'
        run: |
          pacman --noconfirm -U artifact/mingw-w64-*-ghdl-llvm-*.zst
          pip3 install --disable-pip-version-check -r testsuite/requirements.txt

      - name: '🚦 Run tests to generate coverage report'
        run: PYTHONPATH=$(pwd) python3 -m pytest -rA --cov=.. --cov-config=.coveragerc testsuite/pyunit

      - name: Generate XML coverage report
        if: always()
        run: coverage xml

      - name: '📤 Upload artifact: coverage report'
        if: always()
        uses: actions/upload-artifact@v3
        with:
          name: coverage
          path: coverage.xml

#
# Coverage Publish (Ubuntu)
#

  coverage-publish:
    name: '📮 Publish coverage report'
    runs-on: ubuntu-latest

    needs:
      - coverage

    if: always() && github.repository == 'ghdl/ghdl' && github.event_name != 'pull_request'

    steps:

      - name: '📥 Download artifact: coverage report'
        uses: actions/download-artifact@v3
        with:
          path: .
          name: coverage

      - name: CodeCov
        uses: codecov/codecov-action@v3
        with:
          file: coverage.xml
          flags: unittests

      - name: Codacy
        uses: codacy/codacy-coverage-reporter-action@v1
        with:
          project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
          coverage-reports: coverage.xml

#---

# TODO:
# - Re-package a MINGW/MSYS2 package to provide a 'standalone' tarball/zipfile.
#  - https://github.com/ghdl/ghdl/issues/318#issuecomment-286246287
#
# - Add GNAT GPL 32-bit build job with mcode backend