diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 56af0b1..f8efcf9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -144,3 +144,65 @@ jobs: ccache -M 400M ccache -c + cygwin: + runs-on: windows-latest + + strategy: + fail-fast: false + matrix: + boards: [arm-12-win, sim] + + steps: + - run: git config --global core.autocrlf false + - name: Checkout nuttx repo + uses: actions/checkout@v2 + with: + repository: apache/incubator-nuttx + path: nuttx + fetch-depth: 0 + + - name: Fetch nuttx tags + run: | + cd nuttx + git fetch --tags + + - name: Checkout apps repo + uses: actions/checkout@v2 + with: + repository: apache/incubator-nuttx-apps + path: apps + fetch-depth: 0 + + - name: Checkout testing repo + uses: actions/checkout@v2 + with: + repository: apache/incubator-nuttx-testing + path: testing + + - name: Restore tools cache + id: cache-tools + uses: actions/cache@v2 + env: + cache-name: ${{ runner.os }}-cache-tools + with: + path: prebuilt + key: ${{ runner.os }}-tools-${{ hashFiles('./testing/cibuild.sh') }} + + - name: Install cygwin base packages with chocolatey + shell: pwsh + run: | + choco install --no-progress cygwin --version 3.1.4 + choco install cyg-get + - name: Install Build Requirements for Cygwin + run: | + cyg-get make gcc-core gcc-g++ flex git bison byacc gperf gdb unzip awk ` + automake-1.15 autoconf wget xxd libmpc-devel libncurses-devel ` + libmpfr-devel zlib-devel patch + - name: Set Cygwin PATH env + run: | + echo '::set-env name=PATH::C:\tools\cygwin\bin;C:\tools\cygwin\usr\bin' + echo "::add-matcher::nuttx/.github/gcc.json" + - name: Run builds + shell: cmd + run: | + C:\tools\cygwin\bin\bash.exe --noprofile --norc -e -o pipefail -c "cd testing &&./cibuild.sh -i testlist/${{matrix.boards}}.dat" diff --git a/cibuild.sh b/cibuild.sh index 928ea8f..3c86610 100755 --- a/cibuild.sh +++ b/cibuild.sh @@ -32,9 +32,18 @@ nuttx=$WORKSPACE/nuttx apps=$WORKSPACE/apps tools=$WORKSPACE/tools prebuilt=$WORKSPACE/prebuilt -os=$(uname -s) EXTRA_PATH= + +kernel="$(uname -s)" +case $kernel in + Linux*) os=Linux;; + Darwin*) os=Darwin;; + CYGWIN*) os=Cygwin;; + MINGW*) os=MinGw;; + *) os="UNKNOWN:$kernel" +esac + case $os in Darwin) install="python-tools u-boot-tools elf-toolchain gen-romfs kconfig-frontends arm-gcc-toolchain riscv-gcc-toolchain xtensa-esp32-gcc-toolchain avr-gcc-toolchain c-cache binutils" @@ -44,6 +53,9 @@ case $os in Linux) install="python-tools gen-romfs gperf kconfig-frontends arm-gcc-toolchain mips-gcc-toolchain riscv-gcc-toolchain xtensa-esp32-gcc-toolchain rx-gcc-toolchain c-cache" ;; + Cygwin) + install="gen-romfs kconfig-frontends arm-gcc-toolchain" + ;; esac function add_path { @@ -115,6 +127,9 @@ function kconfig-frontends { add_path $prebuilt/kconfig-frontends/bin if [ ! -f "$prebuilt/kconfig-frontends/bin/kconfig-conf" ]; then + if [ ! -d "$tools" ]; then + git clone https://bitbucket.org/nuttx/tools.git $tools + fi cd $tools/kconfig-frontends ./configure --prefix=$prebuilt/kconfig-frontends \ --disable-kconfig --disable-nconf --disable-qconf \ @@ -142,22 +157,33 @@ function bloaty { function arm-gcc-toolchain { add_path $prebuilt/gcc-arm-none-eabi/bin + urlbase="https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/" + releasebase="gcc-arm-none-eabi-9-2019-q4-major" if [ ! -f "$prebuilt/gcc-arm-none-eabi/bin/arm-none-eabi-gcc" ]; then - local flavor + cd $prebuilt + local filename case $os in Darwin) - flavor=mac - ;; + filename="$releasebase-mac.tar.bz2" + wget --quiet $urlbase/$filename + tar jxf $filename + mv $releasebase gcc-arm-none-eabi + ;; Linux) - flavor=x86_64-linux + filename="$releasebase-x86_64.tar.bz2" + wget --quiet $urlbase/$filename + tar jxf $filename + mv $releasebase gcc-arm-none-eabi + ;; + Cygwin) + filename="$releasebase-win32.zip" + wget --quiet $urlbase/$filename + mkdir -p gcc-arm-none-eabi + unzip -qq $filename -d ./gcc-arm-none-eabi ;; esac - cd $prebuilt - wget --quiet https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-${flavor}.tar.bz2 - tar jxf gcc-arm-none-eabi-9-2019-q4-major-${flavor}.tar.bz2 - mv gcc-arm-none-eabi-9-2019-q4-major gcc-arm-none-eabi - rm gcc-arm-none-eabi-9-2019-q4-major-${flavor}.tar.bz2 + rm $filename fi arm-none-eabi-gcc --version } @@ -322,6 +348,9 @@ function binutils { case $os in Darwin) brew install binutils + # It is possible we cached prebuilt but did brew install so recreate + # simlink if it exists + rm -f $prebuilt/bintools/bin/objcopy ln -s /usr/local/opt/binutils/bin/objcopy $prebuilt/bintools/bin/objcopy ;; esac @@ -391,6 +420,9 @@ function run_builds { Linux) ncpus=`grep -c ^processor /proc/cpuinfo` ;; + Cygwin) + ncpus=`grep -c ^processor /proc/cpuinfo` + ;; esac options+="-j $ncpus" diff --git a/testlist/arm-12-win.dat b/testlist/arm-12-win.dat new file mode 100644 index 0000000..e725df2 --- /dev/null +++ b/testlist/arm-12-win.dat @@ -0,0 +1,5 @@ +/arm/stm32f0l0g0,CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIW + +/arm/stm32f7,CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIW + +/arm/stm32h7,CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIW