Skip to content

Commit ed15b3c

Browse files
dlechdpgeorge
authored andcommitted
github/workflows: Move Windows CI from AppVeyor to GitHub Actions.
By moving to GitHub actions, all MicroPython CI builds are now on GitHub actions. This allows faster parallel builds and saves time by not building when no relevant files changed. This reveals a few failing tests, so those are temporarily disabled until they can be fixed. Signed-off-by: David Lechner <[email protected]> Signed-off-by: Damien George <[email protected]>
1 parent 23342ef commit ed15b3c

File tree

3 files changed

+134
-91
lines changed

3 files changed

+134
-91
lines changed

.github/workflows/ports_windows.yml

Lines changed: 126 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,132 @@ concurrency:
1818
cancel-in-progress: true
1919

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

ports/windows/.appveyor.yml

Lines changed: 0 additions & 90 deletions
This file was deleted.

tests/run-tests.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,14 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1):
532532
if os.getenv("GITHUB_ACTIONS") == "true":
533533
skip_tests.add("thread/stress_schedule.py") # has reliability issues
534534

535+
if os.getenv("RUNNER_OS") == "Windows":
536+
# fails with stack overflow on Debug builds
537+
skip_tests.add("misc/sys_settrace_features.py")
538+
539+
if os.getenv("MSYSTEM") is not None:
540+
# fails due to wrong path separator
541+
skip_tests.add("import/import_file.py")
542+
535543
if upy_float_precision == 0:
536544
skip_tests.add("extmod/uctypes_le_float.py")
537545
skip_tests.add("extmod/uctypes_native_float.py")

0 commit comments

Comments
 (0)