Files
ficus/.github/workflows/ficus.yml
2024-07-14 22:50:28 +02:00

128 lines
4.3 KiB
YAML

name: Ficus build
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
BUILD_TYPE: Debug
jobs:
build-generic-toolchain:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install sudo for ACT runner
run: apt-get update && apt-get install -y sudo
if: env.ACT=='true'
- name: Cache generic toolchain
id: cache-toolchain
uses: actions/cache@v3
env:
cache-name: cache-toolchain
with:
path: ./toolchain
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('toolchain_scripts/*') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('toolchain_scripts/*') }}
- if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
name: Build generic toolchain
run: source env.sh && toolchain_scripts/build-all.sh
- if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
name: Strip toolchain
continue-on-error: true
run: find toolchain -type f | xargs strip
- name: Tar the toolchain
run: cd ${{github.workspace}} && tar -czvf toolchain-generic.tar.xz toolchain
- name: Upload ficus toolchain
uses: actions/upload-artifact@v3
with:
name: toolchain-generic
path: ${{github.workspace}}/toolchain-generic.tar.xz
retention-days: 5
build-ficus-toolchain:
runs-on: ubuntu-latest
needs: build-generic-toolchain
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install sudo for ACT runner
run: apt-get update && apt-get install -y sudo
if: env.ACT=='true'
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y cmake build-essential pax gcc g++ nasm bison bzip2 flex mtools texinfo libgmp-dev libmpfr-dev libmpc-dev xorriso
- name: Download toolchain
uses: actions/download-artifact@v3
with:
name: toolchain-generic
path: ${{github.workspace}}
- name: Untar the toolchain
run: cd ${{github.workspace}} && tar xf toolchain-generic.tar.xz
- name: Build ficus toolchain
run: source ${{github.workspace}}/env.sh && ${{github.workspace}}/ficus-toolchain/build-all.sh all
- name: Tar the toolchain
run: cd ${{github.workspace}} && tar -czvf toolchain-ficus.tar.xz toolchain sysroot
- name: Upload ficus toolchain
uses: actions/upload-artifact@v3
with:
name: toolchain-ficus
path: ${{github.workspace}}/toolchain-ficus.tar.xz
retention-days: 5
iso:
needs: build-ficus-toolchain
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install sudo for ACT runner
run: apt-get update && apt-get install -y sudo
if: env.ACT=='true'
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y cmake build-essential pax gcc g++ nasm bison bzip2 flex mtools texinfo libgmp-dev libmpfr-dev libmpc-dev xorriso
- name: Download toolchain
uses: actions/download-artifact@v3
with:
name: toolchain-ficus
path: ${{github.workspace}}
- name: Untar the toolchain
run: cd ${{github.workspace}} && tar xf toolchain-ficus.tar.xz
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: source ${{github.workspace}}/env.sh && cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DFICUS_ROOT=${{github.workspace}} -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/CMake-x86_64-ficus-toolchain.cmake
- name: Build iso
# Build your program with the given configuration
run: source ${{github.workspace}}/env.sh && cmake --build ${{github.workspace}}/build --target iso --config ${{env.BUILD_TYPE}} --parallel $(nproc)
- name: Upload isos
uses: actions/upload-artifact@v3
with:
name: iso
path: ${{github.workspace}}/build/**/*.iso
retention-days: 5