2023-03-09 02:47:17 +00:00
|
|
|
---
|
2020-08-20 08:28:07 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
2020-08-24 08:38:36 +00:00
|
|
|
crosstool:
|
2020-11-10 17:03:36 +00:00
|
|
|
runs-on: ${{ matrix.host }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-10-23 22:36:33 +00:00
|
|
|
host: ["ubuntu-22.04", "macos-latest"]
|
2020-08-20 08:28:07 +00:00
|
|
|
steps:
|
|
|
|
- name: "clone"
|
2024-03-05 23:32:09 +00:00
|
|
|
uses: actions/checkout@v4
|
2020-11-10 17:03:36 +00:00
|
|
|
- name: "prereq Linux"
|
|
|
|
if: ${{ runner.os == 'Linux' }}
|
2020-08-20 08:28:07 +00:00
|
|
|
run: |
|
2022-07-26 04:11:26 +00:00
|
|
|
sudo apt-get install -y gperf help2man libtool-bin meson ninja-build
|
2020-11-10 17:03:36 +00:00
|
|
|
- name: "prereq macOS"
|
|
|
|
if: ${{ runner.os == 'macOS' }}
|
|
|
|
run: |
|
|
|
|
brew install autoconf automake bash binutils gawk gnu-sed \
|
2021-11-10 00:45:11 +00:00
|
|
|
gnu-tar help2man make ncurses
|
2020-08-20 08:28:07 +00:00
|
|
|
- name: "build ct-ng"
|
|
|
|
run: |
|
2020-11-10 17:03:36 +00:00
|
|
|
if [ "$RUNNER_OS" == "macOS" ]; then
|
2024-03-05 23:14:12 +00:00
|
|
|
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
|
2020-11-10 17:03:36 +00:00
|
|
|
fi
|
2020-08-20 08:28:07 +00:00
|
|
|
./bootstrap
|
2024-03-05 23:14:12 +00:00
|
|
|
./configure --prefix="$PWD/.local/"
|
2020-08-20 08:28:07 +00:00
|
|
|
make
|
2020-08-24 08:38:36 +00:00
|
|
|
make install
|
|
|
|
tar -cf ct-ng.tar .local/
|
|
|
|
- name: "upload ct-ng"
|
2024-03-05 23:32:09 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2020-08-24 08:38:36 +00:00
|
|
|
with:
|
2020-11-10 17:03:36 +00:00
|
|
|
name: crosstool.${{ matrix.host }}
|
2020-08-24 08:38:36 +00:00
|
|
|
path: ct-ng.tar
|
2020-08-22 23:56:20 +00:00
|
|
|
- name: "upload config.log"
|
2024-03-05 23:32:09 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2020-08-22 23:56:20 +00:00
|
|
|
with:
|
2020-11-10 17:03:36 +00:00
|
|
|
name: config.log.${{ matrix.host }}
|
2020-08-22 23:56:20 +00:00
|
|
|
path: config.log
|
|
|
|
if: ${{ always() }}
|
2020-08-24 08:38:36 +00:00
|
|
|
|
2021-06-20 00:29:41 +00:00
|
|
|
tarballs:
|
2020-08-24 08:38:36 +00:00
|
|
|
needs: crosstool
|
2020-11-10 17:03:36 +00:00
|
|
|
runs-on: ${{ matrix.host }}
|
2021-06-20 00:29:41 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-10-23 22:36:33 +00:00
|
|
|
host: ["ubuntu-22.04"]
|
2021-06-20 00:29:41 +00:00
|
|
|
steps:
|
|
|
|
- name: "download ct-ng"
|
2024-03-05 23:32:09 +00:00
|
|
|
uses: actions/download-artifact@v4
|
2021-06-20 00:29:41 +00:00
|
|
|
with:
|
|
|
|
name: crosstool.${{ matrix.host }}
|
|
|
|
- name: "extract ct-ng"
|
|
|
|
run: |
|
|
|
|
tar -xf ct-ng.tar
|
2023-09-19 17:43:10 +00:00
|
|
|
- name: cache tarballs
|
|
|
|
id: cache
|
2024-03-05 23:32:09 +00:00
|
|
|
uses: actions/cache@v4
|
2023-09-19 17:43:10 +00:00
|
|
|
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
|
2021-06-20 00:29:41 +00:00
|
|
|
- name: "prereq Linux"
|
|
|
|
if: ${{ runner.os == 'Linux' }}
|
|
|
|
run: |
|
|
|
|
sudo apt-get install -y gperf help2man libtool-bin
|
2024-03-05 23:32:09 +00:00
|
|
|
echo "$GITHUB_WORKSPACE/.local/bin" >> "$GITHUB_PATH"
|
2021-06-20 00:29:41 +00:00
|
|
|
- name: "ct-ng source"
|
|
|
|
run: |
|
|
|
|
mkdir -p src
|
|
|
|
for sample in aarch64-unknown-linux-gnu arm-picolibc-eabi \
|
2022-07-26 02:31:54 +00:00
|
|
|
arm-unknown-linux-musleabi armv6-nommu-linux-uclibcgnueabi \
|
|
|
|
x86_64-w64-mingw32; do \
|
2021-06-20 00:29:41 +00:00
|
|
|
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; \
|
2021-08-23 01:43:28 +00:00
|
|
|
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; \
|
2021-06-20 00:29:41 +00:00
|
|
|
ct-ng source; \
|
|
|
|
done
|
2023-09-19 17:43:10 +00:00
|
|
|
find src -type f -not -newer stamp -delete -print
|
2021-06-20 00:29:41 +00:00
|
|
|
tar -cvf src.tar src
|
|
|
|
|
|
|
|
toolchains:
|
2022-10-23 22:36:33 +00:00
|
|
|
needs: [crosstool, tarballs]
|
2022-02-18 08:58:56 +00:00
|
|
|
uses: ./.github/workflows/build-toolchains.yml
|
|
|
|
with:
|
|
|
|
samples: >-
|
|
|
|
[
|
|
|
|
"aarch64-unknown-linux-gnu",
|
2024-01-31 21:16:52 +00:00
|
|
|
"aarch64-unknown-linux-musl",
|
2022-02-18 08:58:56 +00:00
|
|
|
"arc-multilib-elf32",
|
|
|
|
"arc-multilib-linux-gnu",
|
|
|
|
"arc-multilib-linux-uclibc",
|
2023-06-11 00:27:35 +00:00
|
|
|
"arm-picolibc-default",
|
2022-02-18 08:58:56 +00:00
|
|
|
"arm-unknown-linux-gnueabi",
|
|
|
|
"arm-unknown-linux-musleabi",
|
|
|
|
"armv6-nommu-linux-uclibcgnueabi",
|
|
|
|
"avr",
|
2023-11-11 03:24:01 +00:00
|
|
|
"hppa-unknown-linux-gnu",
|
2022-02-18 08:58:56 +00:00
|
|
|
"i686-w64-mingw32",
|
2022-05-19 06:19:18 +00:00
|
|
|
"loongarch64-unknown-linux-gnu",
|
2022-02-18 08:58:56 +00:00
|
|
|
"mips-unknown-elf",
|
|
|
|
"mips-unknown-linux-gnu",
|
|
|
|
"mips64-unknown-linux-gnu",
|
|
|
|
"powerpc-unknown-linux-gnu",
|
|
|
|
"powerpc64-unknown-linux-gnu",
|
|
|
|
"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"
|
|
|
|
]
|
2021-02-13 13:00:45 +00:00
|
|
|
|
2024-03-10 01:35:58 +00:00
|
|
|
# canadian-cross:
|
|
|
|
# needs: [toolchains]
|
|
|
|
# uses: ./.github/workflows/build-toolchains.yml
|
|
|
|
# with:
|
|
|
|
# samples: >-
|
|
|
|
# ["x86_64-w64-mingw32,x86_64-pc-linux-gnu"]
|
|
|
|
# canadian-cross: true
|