aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/Windows-pyGHDL.yml
blob: f0f479763344d8d30cc184ccfeeee6a69b459b92 (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
name: Windows pyGHDL

on:
  workflow_call:

jobs:


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

    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


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

    needs:
      - Build-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