2 Commits

Author SHA1 Message Date
318f322f2a misc: run.sh typo fix
and check ci
2024-07-15 12:58:38 +02:00
913fd3330e CI: remove prebuilt toolchains 2024-07-15 08:54:16 +02:00
4 changed files with 94 additions and 20 deletions

View File

@@ -2,13 +2,12 @@ name: Ficus build
on: on:
push: push:
branches: [ "main" ] branches: ["main"]
pull_request: pull_request:
branches: [ "main" ] branches: ["main"]
env: env:
BUILD_TYPE: Debug BUILD_TYPE: Debug
BUILD_PARALLEL: 3
jobs: jobs:
build-ficus-toolchain: build-ficus-toolchain:
@@ -24,12 +23,94 @@ jobs:
- name: Install dependencies - 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 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 - name: Cache generic toolchain
run: cd ${{github.workspace}} && tar xf toolchain_scripts/toolchain-s1-linux-aarch64.tar.xz id: cache-toolchain
uses: actions/cache/restore@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: Build ficus toolchain - 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: 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 run: source ${{github.workspace}}/env.sh && ${{github.workspace}}/ficus-toolchain/build-all.sh s2only
- 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 - name: Tar the toolchain
run: cd ${{github.workspace}} && tar -czvf toolchain-ficus.tar.xz toolchain sysroot run: cd ${{github.workspace}} && tar -czvf toolchain-ficus.tar.xz toolchain sysroot
@@ -71,7 +152,7 @@ jobs:
- name: Build iso - name: Build iso
# Build your program with the given configuration # 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 ${{env.BUILD_PARALLEL}} run: source ${{github.workspace}}/env.sh && cmake --build ${{github.workspace}}/build --target iso --config ${{env.BUILD_TYPE}} --parallel $(nproc)
- name: Upload isos - name: Upload isos
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3

View File

@@ -2,15 +2,14 @@ name: Unit tests
on: on:
push: push:
branches: [ "main" ] branches: ["main"]
pull_request: pull_request:
branches: [ "main" ] branches: ["main"]
env: env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug BUILD_TYPE: Debug
TEST_MODE: UNIT TEST_MODE: UNIT
BUILD_PARALLEL: 3
jobs: jobs:
build: build:
@@ -35,7 +34,7 @@ jobs:
- name: Build - name: Build
# Build your program with the given configuration # Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel ${{env.BUILD_PARALLEL}} run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $(nproc)
- name: Test - name: Test
# Execute tests defined by the CMake configuration. # Execute tests defined by the CMake configuration.

View File

@@ -1,19 +1,13 @@
#!/bin/bash #!/bin/bash
if [ -z "$FICUS_ROOT" ]; then if [ -z "$FICUS_ROOT" ]; then
echo "$FICUS_ROOT" is blank echo "$FICUS_ROOT" is blank
fi fi
export PREFIX="$FICUS_ROOT/toolchain/gcc-x86_64-ficus-prefix/" export PREFIX="$FICUS_ROOT/toolchain/gcc-x86_64-ficus-prefix/"
export TARGET=x86_64-ficus export TARGET=x86_64-ficus
export PATH="$PREFIX/bin:$PATH" export PATH="$PREFIX/bin:$PATH"
if [ -z "${BUILD_PARALLEL}" ] if [ -z "${BUILD_PARALLEL}" ]; then
then
export BUILD_PARALLEL=$(nproc) export BUILD_PARALLEL=$(nproc)
fi fi
if [ -z "${BUILD_PARALLEL}" ]
then
export BUILD_PARALLEL=$BUILD_PARALLEL
fi

2
run.sh
View File

@@ -39,7 +39,7 @@ while [[ $# -gt 0 ]]; do
exit 1 exit 1
fi fi
TERM_USED=true TERM_USED=true
# serial # monitor
QEMU_OPTS="$QEMU_OPTS -monitor stdio" QEMU_OPTS="$QEMU_OPTS -monitor stdio"
shift shift
;; ;;