From 6c25a0b3249229b2cf21e8da2b69d446275cdfa1 Mon Sep 17 00:00:00 2001 From: Stepan Usatiuk Date: Sun, 14 Jul 2024 22:32:40 +0200 Subject: [PATCH] generic toolchain build in CI --- .github/workflows/ficus.yml | 55 ++++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ficus.yml b/.github/workflows/ficus.yml index fffce2334..05ec2ff79 100644 --- a/.github/workflows/ficus.yml +++ b/.github/workflows/ficus.yml @@ -2,17 +2,58 @@ name: Ficus build on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] env: BUILD_TYPE: Debug BUILD_PARALLEL: 3 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 @@ -24,8 +65,14 @@ jobs: - 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: Unpack prebuilt toolchain - run: cd ${{github.workspace}} && tar xf toolchain_scripts/toolchain-s1-linux-aarch64.tar.xz + - 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 s2only