|
| 1 | +name: windows port |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + paths: |
| 7 | + - '.github/workflows/*.yml' |
| 8 | + - 'tools/**' |
| 9 | + - 'py/**' |
| 10 | + - 'extmod/**' |
| 11 | + - 'lib/**' |
| 12 | + - 'ports/unix/**' |
| 13 | + - 'ports/windows/**' |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + runs-on: windows-2019 |
| 18 | + defaults: |
| 19 | + run: |
| 20 | + # We define a custom shell script here, although `msys2.cmd` does neither exist nor is it available in the PATH yet |
| 21 | + shell: msys2 {0} |
| 22 | + steps: |
| 23 | + |
| 24 | + # 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). |
| 25 | + - run: git config --global core.autocrlf input |
| 26 | + shell: bash |
| 27 | + |
| 28 | + - name: Check python coding (cmd) |
| 29 | + run: | |
| 30 | + python -c "import sys, locale; print(sys.getdefaultencoding(), locale.getpreferredencoding(False))" |
| 31 | + shell: cmd |
| 32 | + |
| 33 | + # We use a JS Action, which calls the system terminal or other custom terminals directly, if required |
| 34 | + - uses: msys2/setup-msys2@v2 |
| 35 | + with: |
| 36 | + update: true |
| 37 | + install: base-devel git wget unzip gcc python-pip |
| 38 | + |
| 39 | + # The goal of this was to test how things worked when the default file |
| 40 | + # encoding (locale.getpreferedencoding()) was not UTF-8. However, msys2 |
| 41 | + # python does use utf-8 as the preferred file encoding, and using |
| 42 | + # actions/setup-python python3.8 gave a broken build, so we're not really |
| 43 | + # testing what we wanted to test. |
| 44 | + # |
| 45 | + # however, commandline length limits are being tested so that does some |
| 46 | + # good. |
| 47 | + - name: Check python coding (msys2) |
| 48 | + run: | |
| 49 | + locale -v |
| 50 | + which python; python --version |
| 51 | + python -c "import sys, locale; print(sys.getdefaultencoding(), locale.getpreferredencoding(False))" |
| 52 | + which python3; python3 --version |
| 53 | + python3 -c "import sys, locale; print(sys.getdefaultencoding(), locale.getpreferredencoding(False))" |
| 54 | +
|
| 55 | + - name: Install dependencies |
| 56 | + run: | |
| 57 | + 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 |
| 58 | + unzip -q -d /tmp gcc-arm.zip |
| 59 | + tar -C /tmp/gcc-arm-none-* -cf - . | tar -C /usr/local -xf - |
| 60 | + pip install wheel |
| 61 | + # requirements_dev.txt doesn't install on windows. (with msys2 python) |
| 62 | + # instead, pick a subset for what we want to do |
| 63 | + pip install cascadetoml jinja2 typer |
| 64 | + # check that installed packages work....? |
| 65 | + which python; python --version; python -c "import cascadetoml" |
| 66 | + which python3; python3 --version; python3 -c "import cascadetoml" |
| 67 | +
|
| 68 | + - uses: actions/checkout@v2 |
| 69 | + with: |
| 70 | + submodules: true |
| 71 | + fetch-depth: 0 |
| 72 | + |
| 73 | + - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* |
| 74 | + - name: CircuitPython version |
| 75 | + run: | |
| 76 | + git describe --dirty --tags |
| 77 | + echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags) |
| 78 | +
|
| 79 | + - name: build mpy-cross |
| 80 | + run: make -j2 -C mpy-cross |
| 81 | + |
| 82 | + - name: build rp2040 |
| 83 | + run: make -j2 -C ports/raspberrypi BOARD=adafruit_feather_rp2040 TRANSLATION=de_DE |
| 84 | + |
| 85 | + - name: build samd21 |
| 86 | + run: make -j2 -C ports/atmel-samd BOARD=feather_m0_express TRANSLATION=zh_Latn_pinyin |
| 87 | + |
| 88 | + - name: build samd51 |
| 89 | + run: make -j2 -C ports/atmel-samd BOARD=feather_m4_express TRANSLATION=es |
| 90 | + |
| 91 | + - name: build nrf |
| 92 | + run: make -j2 -C ports/nrf BOARD=feather_nrf52840_express TRANSLATION=fr |
| 93 | + |
| 94 | + - name: build stm |
| 95 | + run: make -j2 -C ports/stm BOARD=feather_stm32f405_express TRANSLATION=pt_BR |
| 96 | + |
| 97 | +# I gave up trying to do esp32 builds on windows when I saw |
| 98 | +# ERROR: Platform MINGW64_NT-10.0-17763-x86_64 appears to be unsupported |
| 99 | +# https://github.com/espressif/esp-idf/issues/7062 |
| 100 | +# |
| 101 | +# - name: prepare esp |
| 102 | +# run: ports/esp32s2/esp-idf/install.bat |
| 103 | +# shell: cmd |
| 104 | +# |
| 105 | +# - name: build esp |
| 106 | +# run: . ports/esp32s2/esp-idf/export.sh && make -j2 -C ports/esp32s2 BOARD=adafruit_metro_esp32s2 |
0 commit comments