Skip to content

Commit 5e2433d

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 5e2433d

File tree

3 files changed

+125
-91
lines changed

3 files changed

+125
-91
lines changed

.github/workflows/ports_windows.yml

Lines changed: 117 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,123 @@ 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+
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:
21137
runs-on: ubuntu-latest
22138
steps:
23139
- 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