@@ -17,7 +17,130 @@ concurrency:
17
17
cancel-in-progress : true
18
18
19
19
jobs :
20
- build :
20
+ build-vs :
21
+ strategy :
22
+ fail-fast : false
23
+ matrix :
24
+ architecture : [x86, x64]
25
+ configuration : [Debug, Release]
26
+ variant : [dev, standard]
27
+ visualstudio : ['2017', '2019', '2022']
28
+ include :
29
+ - visualstudio : ' 2017'
30
+ runner : windows-latest
31
+ vs_version : ' [15, 16)'
32
+ - visualstudio : ' 2019'
33
+ runner : windows-2019
34
+ vs_version : ' [16, 17)'
35
+ - visualstudio : ' 2022'
36
+ runner : windows-2022
37
+ vs_version : ' [17, 18)'
38
+ exclude :
39
+ - variant : standard
40
+ configuration : Debug
41
+ runs-on : ${{ matrix.runner }}
42
+ steps :
43
+ - name : Install Visual Studio 2017
44
+ if : matrix.visualstudio == '2017'
45
+ run : |
46
+ choco install visualstudio2017buildtools
47
+ choco install visualstudio2017-workload-vctools
48
+ choco install windows-sdk-8.1
49
+ - uses : microsoft/setup-msbuild@v1
50
+ with :
51
+ vs-version : ${{ matrix.vs_version }}
52
+ - uses : actions/setup-python@v4
53
+ if : matrix.runner == 'windows-2019'
54
+ with :
55
+ python-version : ' 3.9'
56
+ - uses : actions/checkout@v3
57
+ - name : Build mpy-cross.exe
58
+ run : msbuild mpy-cross\mpy-cross.vcxproj -maxcpucount -property:Configuration=${{ matrix.configuration }} -property:Platform=${{ matrix.architecture }}
59
+ - name : Build micropython.exe
60
+ run : msbuild ports\windows\micropython.vcxproj -maxcpucount -property:Configuration=${{ matrix.configuration }} -property:Platform=${{ matrix.architecture }} -property:PyVariant=${{ matrix.variant }}
61
+ - name : Get micropython.exe path
62
+ id : get_path
63
+ run : |
64
+ $exePath="micropython=$((msbuild ports\windows\micropython.vcxproj -nologo -v:m -t:ShowTargetPath -property:Configuration=${{ matrix.configuration }} -property:Platform=${{ matrix.architecture }} -property:PyVariant=${{ matrix.variant }}).Trim())"
65
+ echo $exePath
66
+ echo $exePath | Set-Content $env:GITHUB_OUTPUT
67
+ - name : Run tests
68
+ id : test
69
+ env :
70
+ MICROPY_MICROPYTHON : ${{ steps.get_path.outputs.micropython }}
71
+ working-directory : tests
72
+ run : python run-tests.py
73
+ - name : Print failures
74
+ if : failure() && steps.test.conclusion == 'failure'
75
+ working-directory : tests
76
+ run : python run-tests.py --print-failures
77
+ - name : Run mpy tests
78
+ id : test_mpy
79
+ env :
80
+ MICROPY_MICROPYTHON : ${{ steps.get_path.outputs.micropython }}
81
+ working-directory : tests
82
+ run : python run-tests.py --via-mpy -d basics float micropython
83
+ - name : Print mpy failures
84
+ if : failure() && steps.test_mpy.conclusion == 'failure'
85
+ working-directory : tests
86
+ run : python run-tests.py --print-failures
87
+
88
+ build-mingw :
89
+ strategy :
90
+ fail-fast : false
91
+ matrix :
92
+ variant : [dev, standard]
93
+ sys : [mingw32, mingw64]
94
+ include :
95
+ - sys : mingw32
96
+ env : i686
97
+ - sys : mingw64
98
+ env : x86_64
99
+ runs-on : windows-2022
100
+ env :
101
+ CHERE_INVOKING : enabled_from_arguments
102
+ defaults :
103
+ run :
104
+ shell : msys2 {0}
105
+ steps :
106
+ - name : Get Python path
107
+ id : python_path
108
+ shell : python
109
+ run : |
110
+ import os
111
+ import sys
112
+ output = f"python={os.fspath(sys.executable)}"
113
+ print(output)
114
+ with open(os.environ["GITHUB_OUTPUT"], "w") as f:
115
+ f.write(output)
116
+ - uses : msys2/setup-msys2@v2
117
+ with :
118
+ msystem : ${{ matrix.sys }}
119
+ update : true
120
+ install : >-
121
+ make
122
+ mingw-w64-${{ matrix.env }}-gcc
123
+ pkg-config
124
+ python3
125
+ git
126
+ diffutils
127
+ - uses : actions/checkout@v3
128
+ - name : Build mpy-cross.exe
129
+ run : make -C mpy-cross -j2
130
+ - name : Update submodules
131
+ run : make -C ports/windows VARIANT=${{ matrix.variant }} submodules
132
+ - name : Build micropython.exe
133
+ run : make -C ports/windows -j2 VARIANT=${{ matrix.variant }}
134
+ - name : Run tests
135
+ id : test
136
+ # msys python breaks tests so we need to use "real" windows python
137
+ run : MICROPY_CPYTHON3=$(cygpath "${{ steps.python_path.outputs.python }}") make -C ports/windows test_full VARIANT=${{ matrix.variant }}
138
+ - name : Print failures
139
+ if : failure() && steps.test.conclusion == 'failure'
140
+ working-directory : tests
141
+ run : python run-tests.py --print-failures
142
+
143
+ cross-build-on-linux :
21
144
runs-on : ubuntu-latest
22
145
steps :
23
146
- uses : actions/checkout@v3
0 commit comments