openwrt/.github/workflows/tools.yml
Paul Spooren 3b23227d43
CI: use buildbot container for building
Instead of using a fresh Linux installation which is setup every time
use the Buildbot container which is used for our own Buildbot
infrastructure, too.
While at it also tidy up the workflow to make it more consistent with
other workflow.

Signed-off-by: Paul Spooren <mail@aparcar.org>
Co-Developed-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-09-30 17:20:24 +02:00

131 lines
3.6 KiB
YAML

name: Build host tools
on:
pull_request:
paths:
- 'tools/**'
- '.github/workflows/tools.yml'
permissions:
contents: read
jobs:
build-macos-latest:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: openwrt
- name: Setup MacOS
run: |
echo "WORKPATH=/Volumes/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/
- name: Install required prereq on MacOS
working-directory: ${{ env.WORKPATH }}/openwrt
run: |
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"
- name: Make prereq
working-directory: ${{ env.WORKPATH }}/openwrt
run: make defconfig
- name: Build tools MacOS
working-directory: ${{ env.WORKPATH }}/openwrt
run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
- name: Upload logs
if: always()
uses: actions/upload-artifact@v2
with:
name: macos-latest-logs
path: ${{ env.WORKPATH }}/openwrt/logs
- name: Upload config
if: always()
uses: actions/upload-artifact@v2
with:
name: macos-latest-config
path: ${{ env.WORKPATH }}/openwrt/.config
build-linux-buildbot:
runs-on: ubuntu-latest
container: registry.gitlab.com/openwrt/buildbot/buildworker-3.4.1
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: 'openwrt'
- name: Fix permission
run: |
chown -R buildbot:buildbot openwrt
- name: Make prereq
shell: su buildbot -c "sh -e {0}"
working-directory: openwrt
run: make defconfig
- name: Build tools BuildBot Container
shell: su buildbot -c "sh -e {0}"
working-directory: openwrt
run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
- name: Upload logs
if: always()
uses: actions/upload-artifact@v2
with:
name: linux-buildbot-logs
path: openwrt/logs
- name: Upload config
if: always()
uses: actions/upload-artifact@v2
with:
name: linux-buildbot-config
path: openwrt/.config