crosstool-ng/.github/workflows/continuous-integration-workflow.yml

148 lines
4.9 KiB
YAML
Raw Normal View History

---
name: CI
on:
push:
pull_request:
jobs:
crosstool:
runs-on: ${{ matrix.host }}
strategy:
matrix:
host: ["ubuntu-22.04", "macos-12"]
steps:
- name: "clone"
uses: actions/checkout@v4
- name: "prereq Linux"
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get update && sudo apt-get install -y bison flex gperf help2man libtool-bin meson ninja-build texinfo
- name: "prereq macOS"
if: ${{ runner.os == 'macOS' }}
run: |
brew install autoconf automake bash binutils gawk gnu-sed \
gnu-tar help2man make ncurses texinfo libtool
- name: "build ct-ng"
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
PATH="$PATH:$(brew --prefix)/opt/binutils/bin"
export PATH
CPPFLAGS="-I$(brew --prefix)/opt/ncurses/include -I$(brew --prefix)/opt/gettext/include"
export CPPFLAGS
LDFLAGS="-L$(brew --prefix)/opt/ncurses/lib -L$(brew --prefix)/opt/gettext/lib"
export LDFLAGS
fi
./bootstrap
./configure --prefix="$PWD/.local/"
make
make install
tar -cf ct-ng.tar .local/
- name: "upload ct-ng"
uses: actions/upload-artifact@v4
with:
name: crosstool.${{ matrix.host }}
path: ct-ng.tar
- name: "upload config.log"
uses: actions/upload-artifact@v4
with:
name: config.log.${{ matrix.host }}
path: config.log
if: ${{ always() }}
tarballs:
needs: crosstool
runs-on: ${{ matrix.host }}
strategy:
matrix:
host: ["ubuntu-22.04"]
steps:
- name: "download ct-ng"
uses: actions/download-artifact@v4
with:
name: crosstool.${{ matrix.host }}
- name: "extract ct-ng"
run: |
tar -xf ct-ng.tar
- name: cache tarballs
id: cache
uses: actions/cache@v4
with:
path: src.tar
key: src.tar-${{ hashFiles('.local/share/crosstool-ng/packages') }}-${{ hashFiles('.local/share/crosstool-ng/samples') }}
restore-keys: |
src.tar-${{ hashFiles('.local/share/crosstool-ng/packages') }}-
src.tar-
- name: extract tarballs
run: |
tar -xvf src.tar || true
touch stamp
- name: "prereq Linux"
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get update && sudo apt-get install -y bison flex gperf help2man libtool-bin texinfo
echo "$GITHUB_WORKSPACE/.local/bin" >> "$GITHUB_PATH"
- name: "ct-ng source"
run: |
mkdir -p src
for sample in aarch64-unknown-linux-gnu arm-picolibc-eabi \
arm-unknown-linux-musleabi armv6-nommu-linux-uclibcgnueabi \
x86_64-w64-mingw32; do \
ct-ng $sample; \
sed -i -e '/CT_LOG_PROGRESS_BAR/s/y$/n/' .config; \
sed -i -e '/CT_LOCAL_TARBALLS_DIR/s/HOME/CT_TOP_DIR/' .config; \
sed -i -e '/CT_PREFIX_DIR/s/HOME/CT_TOP_DIR/' .config; \
sed -i -e 's/^.*CT_COMP_TOOLS_BISON.*$/CT_COMP_TOOLS_BISON=y/' .config; \
sed -i -e 's/^.*CT_COMP_TOOLS_M4.*$/CT_COMP_TOOLS_M4=y/' .config; \
sed -i -e 's/^.*CT_COMP_TOOLS_MAKE.*$/CT_COMP_TOOLS_MAKE=y/' .config; \
ct-ng olddefconfig; \
ct-ng source; \
done
find src -type f -not -newer stamp -delete -print
tar -cvf src.tar src
toolchains:
needs: [crosstool, tarballs]
uses: ./.github/workflows/build-toolchains.yml
with:
samples: >-
[
"aarch64-unknown-linux-gnu",
"aarch64-unknown-linux-musl",
"arc-multilib-elf32",
"arc-multilib-linux-gnu",
"arc-multilib-linux-uclibc",
"arm-picolibc-default",
"arm-unknown-linux-gnueabi",
"arm-unknown-linux-musleabi",
"armv6-nommu-linux-uclibcgnueabi",
"avr",
"hppa-unknown-linux-gnu",
"i686-w64-mingw32",
"loongarch64-unknown-linux-gnu",
"loongarch64-unknown-linux-musl",
"mips-unknown-elf",
"mips-unknown-linux-gnu",
"mips64-unknown-linux-gnu",
"powerpc-unknown-linux-gnu",
"powerpc64-unknown-linux-gnu",
"powerpc64-unknown-linux-musl",
"riscv32-unknown-elf",
"riscv64-unknown-elf",
"s390-unknown-linux-gnu",
"sh-unknown-elf",
"sparc-unknown-linux-gnu",
"x86_64-multilib-linux-uclibc",
"x86_64-unknown-linux-gnu",
"x86_64-w64-mingw32",
"xtensa-fsf-linux-uclibc"
]
# canadian-cross:
# needs: [toolchains]
# uses: ./.github/workflows/build-toolchains.yml
# with:
# samples: >-
# ["x86_64-w64-mingw32,x86_64-pc-linux-gnu"]
# canadian-cross: true