Skip to content

Commit 93f3ede

Browse files
committed
github: Move windows CI builds 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 <david@pybricks.com>
1 parent bb77c1d commit 93f3ede

File tree

4 files changed

+138
-91
lines changed

4 files changed

+138
-91
lines changed

.github/workflows/ports_windows.yml

Lines changed: 124 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,130 @@ concurrency:
1717
cancel-in-progress: true
1818

1919
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:
21144
runs-on: ubuntu-latest
22145
steps:
23146
- uses: actions/checkout@v3

ports/windows/.appveyor.yml

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

ports/windows/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ include $(TOP)/py/mkrules.mk
9292

9393
RUN_TESTS_SKIP += -e math_fun -e float2int_double -e float_parse -e math_domain_special
9494

95+
ifeq ($(MSYSTEM),MINGW32)
96+
# compliler optimizations break float formatting
97+
# https://github.com/micropython/micropython/pull/10267
98+
RUN_TESTS_SKIP += -e format_ints_doubleprec -e format_modulo2_intbig
99+
endif
100+
95101
test: $(BUILD)/$(PROG) $(TOP)/tests/run-tests.py
96102
$(eval DIRNAME=ports/$(notdir $(CURDIR)))
97103
cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(BUILD)/$(PROG) $(PYTHON) ./run-tests.py $(RUN_TESTS_SKIP)

tests/run-tests.py

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

509+
if os.getenv("RUNNER_OS") == "Windows":
510+
# fails with stack overflow on Debug builds
511+
skip_tests.add("misc/sys_settrace_features.py")
512+
513+
if os.getenv("MSYSTEM") is not None:
514+
# fails due to wrong path separator
515+
skip_tests.add("import/import_file.py")
516+
509517
if upy_float_precision == 0:
510518
skip_tests.add("extmod/uctypes_le_float.py")
511519
skip_tests.add("extmod/uctypes_native_float.py")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy