Skip to content

Commit 05b72fc

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 05b72fc

File tree

3 files changed

+112
-91
lines changed

3 files changed

+112
-91
lines changed

.github/workflows/ports_windows.yml

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

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
@@ -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