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