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