@@ -22,12 +22,12 @@ jobs:
2222 outputs :
2323 build-doc : ${{ steps.set-matrix.outputs.build-doc }}
2424 build-boards : ${{ steps.set-matrix.outputs.build-boards }}
25+ build-windows : ${{ steps.set-matrix.outputs.build-windows }}
2526 boards-aarch : ${{ steps.set-matrix.outputs.boards-aarch }}
2627 boards-arm : ${{ steps.set-matrix.outputs.boards-arm }}
28+ boards-atmel : ${{ steps.set-matrix.outputs.boards-atmel }}
2729 boards-esp : ${{ steps.set-matrix.outputs.boards-esp }}
28- boards-nrf : ${{ steps.set-matrix.outputs.boards-nrf }}
2930 boards-riscv : ${{ steps.set-matrix.outputs.boards-riscv }}
30- boards-rpi : ${{ steps.set-matrix.outputs.boards-rpi }}
3131 cp-version : ${{ steps.set-up-submodules.outputs.version }}
3232 steps :
3333 - name : Dump GitHub context
@@ -55,24 +55,23 @@ jobs:
5555 uses : ./.github/actions/deps/external
5656 with :
5757 action : cache
58- # Disabled: Needs to be updated
59- # - name: Get last commit with checks
60- # id: get-last-commit-with-checks
61- # if: github.event_name == 'pull_request'
62- # working-directory: tools
63- # run: python3 -u ci_changes_per_commit.py
64- # env:
65- # REPO: ${{ github.repository }}
66- # PULL: ${{ github.event.number }}
67- # GITHUB_TOKEN: ${{ github.token }}
68- # EXCLUDE_COMMIT: ${{ github.event.after }}
6958 - name : Set up mpy-cross
7059 uses : ./.github/actions/mpy_cross
7160 with :
7261 download : false
62+ - name : Get last commit with checks
63+ id : get-last-commit-with-checks
64+ if : github.event_name == 'pull_request'
65+ working-directory : tools
66+ run : python3 -u ci_changes_per_commit.py
67+ env :
68+ REPO : ${{ github.repository }}
69+ PULL : ${{ github.event.number }}
70+ GITHUB_TOKEN : ${{ github.token }}
71+ EXCLUDE_COMMIT : ${{ github.event.pull_request.head.sha }}
7372 - name : Set head sha
7473 if : github.event_name == 'pull_request'
75- run : echo "HEAD_SHA=$(git show -s --format=%s $GITHUB_SHA | grep -o -P "(?<=Merge ).*(?= into)") " >> $GITHUB_ENV
74+ run : echo "HEAD_SHA=${{ github.event.pull_request.head.sha }} " >> $GITHUB_ENV
7675 - name : Set base sha
7776 if : github.event_name == 'pull_request'
7877 run : |
@@ -220,6 +219,74 @@ jobs:
220219 [ -z "$TWINE_USERNAME" ] || echo "Uploading dev release to PyPi"
221220 [ -z "$TWINE_USERNAME" ] || twine upload circuitpython-stubs/dist/*
222221
222+ build-windows :
223+ runs-on : windows-2022
224+ needs : scheduler
225+ if : ${{ needs.scheduler.outputs.build-windows == 'True' }}
226+ env :
227+ CP_VERSION : ${{ needs.scheduler.outputs.cp-version }}
228+ defaults :
229+ run :
230+ # We define a custom shell script here, although `msys2.cmd` does neither exist nor is it available in the PATH yet
231+ shell : msys2 {0}
232+ steps :
233+ # We want to change the configuration of the git command that actions/checkout will be using
234+ # (since it is not possible to set autocrlf through the action yet, see actions/checkout#226).
235+ - run : git config --global core.autocrlf input
236+ shell : bash
237+ - name : Check python coding (cmd)
238+ run : python -c "import sys, locale; print(sys.getdefaultencoding(), locale.getpreferredencoding(False))"
239+ shell : cmd
240+ # We use a JS Action, which calls the system terminal or other custom terminals directly, if required
241+ - uses : msys2/setup-msys2@v2
242+ with :
243+ install : base-devel git wget unzip gcc python-pip
244+ # The goal of this was to test how things worked when the default file encoding (locale.getpreferedencoding())
245+ # was not UTF-8. However, msys2 python does use utf-8 as the preferred file encoding, and using actions/setup-python
246+ # python3.8 gave a broken build, so we're not really testing what we wanted to test.
247+ # However, commandline length limits are being tested so that does some good.
248+ - name : Check python coding (msys2)
249+ run : |
250+ locale -v
251+ which python; python --version
252+ python -c "import sys, locale; print(sys.getdefaultencoding(), locale.getpreferredencoding(False))"
253+ which python3; python3 --version
254+ python3 -c "import sys, locale; print(sys.getdefaultencoding(), locale.getpreferredencoding(False))"
255+ - name : Install dependencies
256+ run : |
257+ 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
258+ unzip -q -d /tmp gcc-arm.zip
259+ tar -C /tmp/gcc-arm-none-* -cf - . | tar -C /usr/local -xf -
260+ pip install wheel
261+ # requirements_dev.txt doesn't install on windows. (with msys2 python)
262+ # instead, pick a subset for what we want to do
263+ pip install cascadetoml jinja2 typer click intelhex
264+ # check that installed packages work....?
265+ which python; python --version; python -c "import cascadetoml"
266+ which python3; python3 --version; python3 -c "import cascadetoml"
267+ - name : Set up repository
268+ uses : actions/checkout@v3
269+ with :
270+ submodules : false
271+ fetch-depth : 1
272+ - name : Set up submodules
273+ uses : ./.github/actions/deps/submodules
274+ - name : build mpy-cross
275+ run : make -j2 -C mpy-cross
276+ - name : build rp2040
277+ run : make -j2 -C ports/raspberrypi BOARD=adafruit_feather_rp2040 TRANSLATION=de_DE
278+ - name : build samd21
279+ run : make -j2 -C ports/atmel-samd BOARD=feather_m0_express TRANSLATION=zh_Latn_pinyin
280+ - name : build samd51
281+ run : make -j2 -C ports/atmel-samd BOARD=feather_m4_express TRANSLATION=es
282+ - name : build nrf
283+ run : make -j2 -C ports/nrf BOARD=feather_nrf52840_express TRANSLATION=fr
284+ - name : build stm
285+ run : make -j2 -C ports/stm BOARD=feather_stm32f405_express TRANSLATION=pt_BR
286+ # I gave up trying to do esp builds on windows when I saw
287+ # ERROR: Platform MINGW64_NT-10.0-17763-x86_64 appears to be unsupported
288+ # https://github.com/espressif/esp-idf/issues/7062
289+
223290 aarch :
224291 needs : [scheduler, mpy-cross, tests]
225292 if : ${{ needs.scheduler.outputs.boards-aarch != '[]' }}
@@ -240,24 +307,24 @@ jobs:
240307 boards : ${{ needs.scheduler.outputs.boards-arm }}
241308 cp-version : ${{ needs.scheduler.outputs.cp-version }}
242309
243- esp :
310+ atmel :
244311 needs : [scheduler, mpy-cross, tests]
245- if : ${{ needs.scheduler.outputs.boards-esp != '[]' }}
312+ if : ${{ needs.scheduler.outputs.boards-atmel != '[]' }}
246313 uses : ./.github/workflows/build-boards.yml
247314 secrets : inherit
248315 with :
249- platform : esp
250- boards : ${{ needs.scheduler.outputs.boards-esp }}
316+ platform : arm
317+ boards : ${{ needs.scheduler.outputs.boards-atmel }}
251318 cp-version : ${{ needs.scheduler.outputs.cp-version }}
252319
253- nrf :
320+ esp :
254321 needs : [scheduler, mpy-cross, tests]
255- if : ${{ needs.scheduler.outputs.boards-nrf != '[]' }}
322+ if : ${{ needs.scheduler.outputs.boards-esp != '[]' }}
256323 uses : ./.github/workflows/build-boards.yml
257324 secrets : inherit
258325 with :
259- platform : nrf
260- boards : ${{ needs.scheduler.outputs.boards-nrf }}
326+ platform : esp
327+ boards : ${{ needs.scheduler.outputs.boards-esp }}
261328 cp-version : ${{ needs.scheduler.outputs.cp-version }}
262329
263330 riscv :
@@ -269,13 +336,3 @@ jobs:
269336 platform : riscv
270337 boards : ${{ needs.scheduler.outputs.boards-riscv }}
271338 cp-version : ${{ needs.scheduler.outputs.cp-version }}
272-
273- rpi :
274- needs : [scheduler, mpy-cross, tests]
275- if : ${{ needs.scheduler.outputs.boards-rpi != '[]' }}
276- uses : ./.github/workflows/build-boards.yml
277- secrets : inherit
278- with :
279- platform : arm
280- boards : ${{ needs.scheduler.outputs.boards-rpi }}
281- cp-version : ${{ needs.scheduler.outputs.cp-version }}
0 commit comments