Skip to content

Commit 990966c

Browse files
committed
ci: Enable format checking in many builds.
Signed-off-by: Jeff Epler <jepler@gmail.com>
1 parent 28e461a commit 990966c

File tree

3 files changed

+40
-12
lines changed

3 files changed

+40
-12
lines changed

.github/workflows/ports_unix.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ jobs:
138138
runs-on: ubuntu-latest
139139
steps:
140140
- uses: actions/checkout@v4
141+
- name: Install packages
142+
run: source tools/ci.sh && ci_unix_float_setup
141143
- name: Build
142144
run: source tools/ci.sh && ci_unix_float_build
143145
- name: Run main test suite

.github/workflows/ports_windows.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,14 @@ jobs:
141141
run: python run-tests.py --print-failures
142142

143143
cross-build-on-linux:
144+
strategy:
145+
fail-fast: false
146+
matrix:
147+
sys: [i386, x86_64]
144148
runs-on: ubuntu-latest
145149
steps:
146150
- uses: actions/checkout@v4
147151
- name: Install packages
148152
run: source tools/ci.sh && ci_windows_setup
149153
- name: Build
150-
run: source tools/ci.sh && ci_windows_build
154+
run: source tools/ci.sh && ci_windows_build ${{ matrix.variant }}

tools/ci.sh

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ function ci_gcc_riscv_setup {
2222
riscv64-unknown-elf-gcc --version
2323
}
2424

25+
function ci_gcc_plugin_setup {
26+
if [ $# -eq 0 ]; then
27+
GCC_VER=$(echo __GNUC__ | gcc -P -E -)
28+
sudo apt-get install gcc-${GCC_VER}-plugin-dev
29+
else
30+
GCC_VER=$(echo __GNUC__ | ${1}-gcc -P -E -)
31+
sudo apt-get install gcc-${GCC_VER}-plugin-dev-${1}
32+
fi
33+
}
34+
2535
function ci_picotool_setup {
2636
# Manually installing picotool ensures we use a release version, and speeds up the build.
2737
git clone https://github.com/raspberrypi/pico-sdk.git
@@ -126,6 +136,7 @@ function ci_mpy_format_setup {
126136
sudo apt-get update
127137
sudo apt-get install python2.7
128138
sudo pip3 install pyelftools
139+
ci_gcc_plugin_setup
129140
python2.7 --version
130141
python3 --version
131142
}
@@ -615,12 +626,15 @@ function ci_unix_coverage_setup {
615626
pip3 install setuptools
616627
pip3 install pyelftools
617628
pip3 install ar
629+
ci_gcc_plugin_setup
618630
gcc --version
619631
python3 --version
620632
}
621633

622634
function ci_unix_coverage_build {
623-
ci_unix_build_helper VARIANT=coverage
635+
# (Ensure mpy-cross is built with the plugin too)
636+
make ${MAKEOPTS} -C mpy-cross MICROPY_USE_COMPILER_PLUGIN=gcc
637+
ci_unix_build_helper VARIANT=coverage MICROPY_USE_COMPILER_PLUGIN=gcc
624638
ci_unix_build_ffi_lib_helper gcc
625639
}
626640

@@ -661,6 +675,7 @@ function ci_unix_32bit_setup {
661675
sudo dpkg --add-architecture i386
662676
sudo apt-get update
663677
sudo apt-get install gcc-multilib g++-multilib libffi-dev:i386 python2.7
678+
ci_gcc_plugin_setup
664679
sudo pip3 install setuptools
665680
sudo pip3 install pyelftools
666681
sudo pip3 install ar
@@ -670,7 +685,7 @@ function ci_unix_32bit_setup {
670685
}
671686

672687
function ci_unix_coverage_32bit_build {
673-
ci_unix_build_helper VARIANT=coverage MICROPY_FORCE_32BIT=1
688+
ci_unix_build_helper VARIANT=coverage MICROPY_FORCE_32BIT=1 MICROPY_USE_COMPILER_PLUGIN=gcc
674689
ci_unix_build_ffi_lib_helper gcc -m32
675690
}
676691

@@ -684,16 +699,20 @@ function ci_unix_coverage_32bit_run_native_mpy_tests {
684699

685700
function ci_unix_nanbox_build {
686701
# Use Python 2 to check that it can run the build scripts
687-
ci_unix_build_helper PYTHON=python2.7 VARIANT=nanbox CFLAGS_EXTRA="-DMICROPY_PY_MATH_CONSTANTS=1"
702+
ci_unix_build_helper PYTHON=python2.7 VARIANT=nanbox CFLAGS_EXTRA="-DMICROPY_PY_MATH_CONSTANTS=1" MICROPY_USE_COMPILER_PLUGIN=gcc
688703
ci_unix_build_ffi_lib_helper gcc -m32
689704
}
690705

691706
function ci_unix_nanbox_run_tests {
692707
ci_unix_run_tests_full_no_native_helper nanbox PYTHON=python2.7
693708
}
694709

710+
function ci_unix_float_setup {
711+
ci_gcc_plugin_setup
712+
}
713+
695714
function ci_unix_float_build {
696-
ci_unix_build_helper VARIANT=standard CFLAGS_EXTRA="-DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT"
715+
ci_unix_build_helper VARIANT=standard CFLAGS_EXTRA="-DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT" MICROPY_USE_COMPILER_PLUGIN=gcc
697716
ci_unix_build_ffi_lib_helper gcc
698717
}
699718

@@ -765,8 +784,8 @@ function ci_unix_macos_build {
765784
#make ${MAKEOPTS} -C ports/unix deplibs
766785
make ${MAKEOPTS} -C ports/unix
767786
# check for additional compiler errors/warnings
768-
make ${MAKEOPTS} -C ports/unix VARIANT=coverage submodules
769-
make ${MAKEOPTS} -C ports/unix VARIANT=coverage
787+
make ${MAKEOPTS} -C ports/unix VARIANT=coverage submodules DISABLE_PLUGIN=1
788+
make ${MAKEOPTS} -C ports/unix VARIANT=coverage DISABLE_PLUGIN=1
770789
}
771790

772791
function ci_unix_macos_run_tests {
@@ -778,15 +797,16 @@ function ci_unix_macos_run_tests {
778797

779798
function ci_unix_qemu_mips_setup {
780799
sudo apt-get update
781-
sudo apt-get install gcc-mips-linux-gnu g++-mips-linux-gnu libc6-mips-cross
800+
sudo apt-get install gcc-10-mips-linux-gnu g++-mips-linux-gnu libc6-mips-cross
782801
sudo apt-get install qemu-user
802+
ci_gcc_plugin_setup mips-linux-gnu
783803
qemu-mips --version
784804
sudo mkdir /etc/qemu-binfmt
785805
sudo ln -s /usr/mips-linux-gnu/ /etc/qemu-binfmt/mips
786806
}
787807

788808
function ci_unix_qemu_mips_build {
789-
ci_unix_build_helper "${CI_UNIX_OPTS_QEMU_MIPS[@]}"
809+
ci_unix_build_helper "${CI_UNIX_OPTS_QEMU_MIPS[@]}" MICROPY_USE_COMPILER_PLUGIN=gcc
790810
ci_unix_build_ffi_lib_helper mips-linux-gnu-gcc
791811
}
792812

@@ -799,13 +819,14 @@ function ci_unix_qemu_arm_setup {
799819
sudo apt-get update
800820
sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
801821
sudo apt-get install qemu-user
822+
ci_gcc_plugin_setup arm-linux-gnueabi
802823
qemu-arm --version
803824
sudo mkdir /etc/qemu-binfmt
804825
sudo ln -s /usr/arm-linux-gnueabi/ /etc/qemu-binfmt/arm
805826
}
806827

807828
function ci_unix_qemu_arm_build {
808-
ci_unix_build_helper "${CI_UNIX_OPTS_QEMU_ARM[@]}"
829+
ci_unix_build_helper "${CI_UNIX_OPTS_QEMU_ARM[@]}" MICROPY_USE_COMPILER_PLUGIN=gcc
809830
ci_unix_build_ffi_lib_helper arm-linux-gnueabi-gcc
810831
}
811832

@@ -820,13 +841,14 @@ function ci_unix_qemu_riscv64_setup {
820841
sudo apt-get update
821842
sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
822843
sudo apt-get install qemu-user
844+
ci_gcc_plugin_setup riscv64-linux-gnu
823845
qemu-riscv64 --version
824846
sudo mkdir /etc/qemu-binfmt
825847
sudo ln -s /usr/riscv64-linux-gnu/ /etc/qemu-binfmt/riscv64
826848
}
827849

828850
function ci_unix_qemu_riscv64_build {
829-
ci_unix_build_helper "${CI_UNIX_OPTS_QEMU_RISCV64[@]}"
851+
ci_unix_build_helper "${CI_UNIX_OPTS_QEMU_RISCV64[@]}" MICROPY_USE_COMPILER_PLUGIN=gcc
830852
ci_unix_build_ffi_lib_helper riscv64-linux-gnu-gcc
831853
}
832854

@@ -845,7 +867,7 @@ function ci_windows_setup {
845867
function ci_windows_build {
846868
make ${MAKEOPTS} -C mpy-cross
847869
make ${MAKEOPTS} -C ports/windows submodules
848-
make ${MAKEOPTS} -C ports/windows CROSS_COMPILE=i686-w64-mingw32-
870+
make ${MAKEOPTS} -C ports/windows CROSS_COMPILE=${1-i686}-w64-mingw32- MICROPY_USE_COMPILER_PLUGIN=gcc
849871
}
850872

851873
########################################################################################

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