mirror of
https://github.com/usatiuk/ficus.git
synced 2025-10-29 08:37:51 +01:00
CI: hopefully working cache?
This commit is contained in:
138
.github/workflows/ficus.yml
vendored
138
.github/workflows/ficus.yml
vendored
@@ -10,49 +10,8 @@ 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
|
||||
@@ -64,17 +23,98 @@ 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: Download toolchain
|
||||
uses: actions/download-artifact@v3
|
||||
- name: Cache generic toolchain
|
||||
id: cache-toolchain
|
||||
uses: actions/cache/restore@v4
|
||||
env:
|
||||
cache-name: cache-toolchain
|
||||
with:
|
||||
name: toolchain-generic
|
||||
path: ${{github.workspace}}
|
||||
path: |
|
||||
toolchain/gcc-i686-elf-prefix
|
||||
toolchain/gcc-x86_64-elf-prefix
|
||||
toolchain/grub
|
||||
toolchain/limine
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('toolchain_scripts/*') }}
|
||||
|
||||
- name: Untar the toolchain
|
||||
run: cd ${{github.workspace}} && tar xf toolchain-generic.tar.xz
|
||||
- if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
|
||||
name: Build generic toolchain
|
||||
run: source env.sh && toolchain_scripts/build-all.sh
|
||||
|
||||
- name: Build ficus toolchain
|
||||
run: source ${{github.workspace}}/env.sh && ${{github.workspace}}/ficus-toolchain/build-all.sh all
|
||||
- if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
|
||||
name: Strip toolchain
|
||||
continue-on-error: true
|
||||
run: find toolchain -type f | xargs strip
|
||||
|
||||
- name: Save generic toolchain
|
||||
id: cache-toolchain-save
|
||||
uses: actions/cache/save@v4
|
||||
env:
|
||||
cache-name: cache-toolchain
|
||||
with:
|
||||
path: |
|
||||
toolchain/gcc-i686-elf-prefix
|
||||
toolchain/gcc-x86_64-elf-prefix
|
||||
toolchain/grub
|
||||
toolchain/limine
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('toolchain_scripts/*') }}
|
||||
|
||||
- name: Cache s1 toolchain
|
||||
id: cache-toolchain-s1
|
||||
uses: actions/cache/restore@v4
|
||||
env:
|
||||
cache-name: cache-toolchain-s1
|
||||
with:
|
||||
path: |
|
||||
toolchain/gcc-x86_64-ficus-prefix
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('ficus-toolchain/*.sh') }}
|
||||
|
||||
- if: ${{ steps.cache-toolchain-s1.outputs.cache-hit != 'true' }}
|
||||
name: Build ficus toolchain s1
|
||||
run: source ${{github.workspace}}/env.sh && ${{github.workspace}}/ficus-toolchain/build-all.sh s1only
|
||||
|
||||
- if: ${{ steps.cache-toolchain-s1.outputs.cache-hit != 'true' }}
|
||||
name: Strip toolchain
|
||||
continue-on-error: true
|
||||
run: find toolchain -type f | xargs strip
|
||||
|
||||
- name: Save s1 toolchain
|
||||
id: cache-toolchain-s1-save
|
||||
uses: actions/cache/save@v4
|
||||
env:
|
||||
cache-name: cache-toolchain-s1
|
||||
with:
|
||||
path: |
|
||||
toolchain/gcc-x86_64-ficus-prefix
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('ficus-toolchain/*.sh') }}
|
||||
|
||||
- name: Cache s2 toolchain
|
||||
id: cache-toolchain-s2
|
||||
uses: actions/cache/restore@v4
|
||||
env:
|
||||
cache-name: cache-toolchain-s2
|
||||
with:
|
||||
path: |
|
||||
toolchain/gcc-x86_64-ficus-prefix
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('ficus-toolchain/*.sh') }}-${{ hashFiles('ficus-toolchain/newlib/**/*') }}
|
||||
|
||||
- if: ${{ steps.cache-toolchain-s2.outputs.cache-hit != 'true' }}
|
||||
name: Build ficus toolchain s2
|
||||
run: source ${{github.workspace}}/env.sh && ${{github.workspace}}/ficus-toolchain/build-all.sh s2only
|
||||
|
||||
- if: ${{ steps.cache-toolchain-s2.outputs.cache-hit != 'true' }}
|
||||
name: Strip toolchain
|
||||
continue-on-error: true
|
||||
run: find toolchain -type f | xargs strip
|
||||
|
||||
- name: Save s2 toolchain
|
||||
id: cache-toolchain-s2-save
|
||||
uses: actions/cache/save@v4
|
||||
env:
|
||||
cache-name: cache-toolchain-s2
|
||||
with:
|
||||
path: |
|
||||
toolchain/gcc-x86_64-ficus-prefix
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('ficus-toolchain/*.sh') }}-${{ hashFiles('ficus-toolchain/newlib/**/*') }}
|
||||
|
||||
- name: Tar the toolchain
|
||||
run: cd ${{github.workspace}} && tar -czvf toolchain-ficus.tar.xz toolchain sysroot
|
||||
|
||||
Reference in New Issue
Block a user