2021-05-27 16:25:29 -04:00
name : windows port
on :
push :
pull_request :
paths :
2023-01-14 06:40:40 -05:00
- '.github/workflows/ports_windows.yml'
2021-05-27 16:25:29 -04:00
- 'extmod/**'
- 'lib/**'
2022-03-28 20:36:28 -04:00
- 'mpy-cross/**'
2021-05-27 16:25:29 -04:00
- 'ports/unix/**'
- 'ports/windows/**'
2022-03-28 20:36:28 -04:00
- 'py/**'
- 'requirements*.txt'
- 'tools/**'
2021-05-27 16:25:29 -04:00
2022-01-25 14:40:25 -05:00
concurrency :
group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress : true
2021-05-27 16:25:29 -04:00
jobs :
build :
2023-01-20 23:54:08 -05:00
runs-on : windows-2022
2021-05-27 16:25:29 -04:00
defaults :
run :
# We define a custom shell script here, although `msys2.cmd` does neither exist nor is it available in the PATH yet
shell : msys2 {0}
steps :
# We want to change the configuration of the git command that actions/checkout will be using (since it is not possible to set autocrlf through the action yet, see actions/checkout#226).
- run : git config --global core.autocrlf input
shell : bash
- name : Check python coding (cmd)
2023-01-20 23:54:08 -05:00
run : python -c "import sys, locale; print(sys.getdefaultencoding(), locale.getpreferredencoding(False))"
2021-05-27 16:25:29 -04:00
shell : cmd
# We use a JS Action, which calls the system terminal or other custom terminals directly, if required
- uses : msys2/setup-msys2@v2
with :
update : true
install : base-devel git wget unzip gcc python-pip
# The goal of this was to test how things worked when the default file
# encoding (locale.getpreferedencoding()) was not UTF-8. However, msys2
# python does use utf-8 as the preferred file encoding, and using
# actions/setup-python python3.8 gave a broken build, so we're not really
# testing what we wanted to test.
#
# however, commandline length limits are being tested so that does some
# good.
- name : Check python coding (msys2)
run : |
locale -v
which python; python --version
python -c "import sys, locale; print(sys.getdefaultencoding(), locale.getpreferredencoding(False))"
which python3; python3 --version
python3 -c "import sys, locale; print(sys.getdefaultencoding(), locale.getpreferredencoding(False))"
- name : Install dependencies
run : |
wget --no-verbose -O gcc-arm.zip https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-win32.zip
unzip -q -d /tmp gcc-arm.zip
tar -C /tmp/gcc-arm-none-* -cf - . | tar -C /usr/local -xf -
pip install wheel
# requirements_dev.txt doesn't install on windows. (with msys2 python)
# instead, pick a subset for what we want to do
2022-04-01 20:51:11 -04:00
pip install cascadetoml jinja2 typer click intelhex
2021-05-27 16:25:29 -04:00
# check that installed packages work....?
which python; python --version; python -c "import cascadetoml"
which python3; python3 --version; python3 -c "import cascadetoml"
2023-01-14 00:28:04 -05:00
- name : Set up repository
uses : actions/checkout@v3
2021-05-27 16:25:29 -04:00
with :
2021-08-04 19:27:54 -04:00
submodules : false
fetch-depth : 1
2023-01-14 00:28:04 -05:00
- name : Create submodule status
2023-01-14 06:40:40 -05:00
run : git submodule status extmod/ulab lib/ tools/ >> submodule_status
2023-01-14 00:28:04 -05:00
- name : Restore submodules
uses : actions/cache/restore@v3
with :
path : |
.git/modules/
extmod/ulab
lib/
tools/
key : submodules-common-${{ hashFiles('submodule_status') }}
enableCrossOsArchive : true
- name : CircuitPython dependencies
run : |
python tools/ci_fetch_deps.py windows
echo "::group::Fetch history and tags"
git fetch --no-recurse-submodules --shallow-since="2021-07-01" --tags https://github.com/adafruit/circuitpython HEAD
git fetch --no-recurse-submodules --shallow-since="2021-07-01" origin $GITHUB_SHA
git repack -d
echo "::endgroup::"
2021-05-27 16:25:29 -04:00
- name : CircuitPython version
run : |
2023-01-20 23:54:08 -05:00
CP_VERSION=$(tools/describe)
echo "$CP_VERSION"
echo "CP_VERSION=$CP_VERSION" >> $GITHUB_ENV
2021-05-27 16:25:29 -04:00
- name : build mpy-cross
run : make -j2 -C mpy-cross
- name : build rp2040
run : make -j2 -C ports/raspberrypi BOARD=adafruit_feather_rp2040 TRANSLATION=de_DE
- name : build samd21
run : make -j2 -C ports/atmel-samd BOARD=feather_m0_express TRANSLATION=zh_Latn_pinyin
- name : build samd51
run : make -j2 -C ports/atmel-samd BOARD=feather_m4_express TRANSLATION=es
- name : build nrf
run : make -j2 -C ports/nrf BOARD=feather_nrf52840_express TRANSLATION=fr
- name : build stm
run : make -j2 -C ports/stm BOARD=feather_stm32f405_express TRANSLATION=pt_BR
# I gave up trying to do esp32 builds on windows when I saw
# ERROR: Platform MINGW64_NT-10.0-17763-x86_64 appears to be unsupported
# https://github.com/espressif/esp-idf/issues/7062
#
# - name: prepare esp
2021-09-13 19:44:55 -04:00
# run: ports/espressif/esp-idf/install.bat
2021-05-27 16:25:29 -04:00
# shell: cmd
#
# - name: build esp
2021-09-13 19:44:55 -04:00
# run: . ports/espressif/esp-idf/export.sh && make -j2 -C ports/espressif BOARD=adafruit_metro_esp32s2