openwrt/.github/workflows/tools.yml
Petr Štetiar f4ca4187cd ci: show build failures directly in job log output
Instead of waiting for complete workflow finish, then downloading the
artifacts, unpacking them and inspecting them, lets try to make the
build failure immediately visible in the log output:

  ====== Make errors from logs/target/linux/compile.txt ======
  * Legacy (non-UHI/non-FIT) Boards
  *
  Support MIPS SEAD-3 boards (LEGACY_BOARD_SEAD3) [N/y/?] (NEW)
  Error in reading or end of file.

  make[6]: *** [scripts/kconfig/Makefile:77: syncconfig] Error 1
  make[5]: *** [Makefile:616: syncconfig] Error 2
  make[4]: *** [Makefile:736: include/config/auto.conf.cmd] Error 2
  make[3]: *** [Makefile:24: build_dir/target-mipsel-openwrt-linux-musl_musl/linux-ramips_mt7620/linux-5.15.62/.modules] Error 2
  make[2]: *** [Makefile:11: compile] Error 2
  time: target/linux/compile#30.09#11.30#37.92

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-09-20 12:14:54 +02:00

148 lines
3.8 KiB
YAML

name: Build host tools
on:
pull_request:
paths:
- 'tools/**'
- '.github/workflows/tools.yml'
permissions:
contents: read
jobs:
build:
name: tools-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: False
matrix:
os:
- ubuntu-latest
- macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
path: openwrt
- name: Setup MacOS
if: ${{ matrix.os == 'macos-latest' }}
run: |
echo "WORKPATH=/Volumes/OpenWrt/openwrt/" >> "$GITHUB_ENV"
hdiutil create -size 20g -type SPARSE -fs "Case-sensitive HFS+" -volname OpenWrt OpenWrt.sparseimage
hdiutil attach OpenWrt.sparseimage
mv "$GITHUB_WORKSPACE/openwrt" /Volumes/OpenWrt/
cd "$WORKPATH"
brew install \
autoconf \
automake \
coreutils \
diffutils \
findutils \
gawk \
gettext \
git-extras \
gmp \
gnu-getopt \
gnu-sed \
gnu-tar \
grep \
libidn2 \
libunistring \
m4 \
make \
mpfr \
ncurses \
openssl@1.1 \
pcre \
pkg-config \
quilt \
readline \
wget \
zstd
echo "/bin" >> "$GITHUB_PATH"
echo "/sbin/Library/Apple/usr/bin" >> "$GITHUB_PATH"
echo "/usr/bin" >> "$GITHUB_PATH"
echo "/usr/local/bin" >> "$GITHUB_PATH"
echo "/usr/local/opt/coreutils/bin" >> "$GITHUB_PATH"
echo "/usr/local/opt/findutils/libexec/gnubin" >> "$GITHUB_PATH"
echo "/usr/local/opt/gettext/bin" >> "$GITHUB_PATH"
echo "/usr/local/opt/gnu-getopt/bin" >> "$GITHUB_PATH"
echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH"
echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH"
echo "/usr/sbin" >> "$GITHUB_PATH"
pwd
- name: Setup Ubuntu
if: ${{ matrix.os == 'ubuntu-latest' }}
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
sudo apt-get -y install \
build-essential \
ccache \
clang-12 \
ecj \
fastjar \
file \
g++ \
gawk \
gettext \
git \
java-propose-classpath \
libelf-dev \
libncurses-dev \
libssl-dev \
mkisofs \
python3 \
python3-dev \
python3-distutils \
python3-setuptools \
qemu-utils \
rsync \
subversion \
swig \
unzip \
wget \
xsltproc \
zlib1g-dev
echo "WORKPATH=$GITHUB_WORKSPACE/openwrt/" >> "$GITHUB_ENV"
cd "$WORKPATH"
pwd
- name: Make prereq
run: |
cd "$WORKPATH"
pwd
make defconfig
- name: Build tools
run: |
cd "$WORKPATH"
make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
- name: Move logs to GITHUB_WORKSPACE
if: always()
run: |
cp -r "$WORKPATH/logs" "$GITHUB_WORKSPACE"
cp -r "$WORKPATH/.config" "$GITHUB_WORKSPACE/config"
- name: Upload logs
if: always()
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}-logs
path: "logs"
- name: Upload config
if: always()
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}-config
path: "config"