mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-05-25 22:14:34 +00:00
210 lines
5.2 KiB
YAML
210 lines
5.2 KiB
YAML
name: Build OS
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
buildcompiler:
|
|
name: Build Cross-Compiler & Toolchain
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Cache cross Folder
|
|
id: cache-cross
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: tools/cross
|
|
key: ${{ runner.os }}-cross-${{ hashFiles('tools/Makefile') }}
|
|
|
|
- name: Prepare Environment for Dev Container
|
|
run: |
|
|
sudo mkdir -p /tmp/.X11-unix
|
|
sudo mkdir -p /run/user/1000/pulse
|
|
sudo touch /tmp/.Xauthority
|
|
sudo touch /run/user/1000/pulse/native
|
|
echo "XAUTHORITY=/tmp/.Xauthority" >> $GITHUB_ENV
|
|
|
|
- name: Run make ci-setup in dev container
|
|
if: steps.cache-cross.outputs.cache-hit != 'true'
|
|
uses: devcontainers/ci@v0.3
|
|
with:
|
|
push: never
|
|
runCmd: |
|
|
/usr/bin/make ci-setup
|
|
|
|
analyze:
|
|
name: Analyze (${{ matrix.language }})
|
|
runs-on: ubuntu-latest
|
|
needs: [buildcompiler]
|
|
permissions:
|
|
security-events: write
|
|
packages: read
|
|
actions: read
|
|
contents: read
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- language: c-cpp
|
|
build-mode: manual
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Check for cache
|
|
id: check-cache
|
|
run: |
|
|
if [ -z "${{ runner.os }}-cross-${{ hashFiles('tools/Makefile') }}" ]; then
|
|
echo "No cache found, cancelling job."
|
|
exit 1
|
|
fi
|
|
|
|
- name: Initialize CodeQL
|
|
uses: github/codeql-action/init@v3
|
|
with:
|
|
languages: ${{ matrix.language }}
|
|
build-mode: ${{ matrix.build-mode }}
|
|
|
|
- if: matrix.build-mode == 'manual'
|
|
shell: bash
|
|
run: |
|
|
echo 'If you are using a "manual" build mode for one or more of the' \
|
|
'languages you are analyzing, replace this with the commands to build' \
|
|
'your code, for example:'
|
|
echo ' make bootstrap'
|
|
echo ' make release'
|
|
exit 0
|
|
|
|
- name: Install Packages
|
|
run: |
|
|
sudo apt update
|
|
sudo apt --no-install-recommends -y install rustc xorriso mtools genisoimage ovmf nasm doxygen make gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 mingw-w64 build-essential bison flex libgmp3-dev libmpc-dev libmpfr-dev texinfo
|
|
make --quiet -C tools do_limine
|
|
make --quiet prepare
|
|
|
|
- name: Cache cross
|
|
id: cache-cross
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: tools/cross
|
|
key: ${{ runner.os }}-cross-${{ hashFiles('tools/Makefile') }}
|
|
|
|
- name: Build OS
|
|
run: |
|
|
make build_userspace
|
|
make build_drivers
|
|
make build_kernel
|
|
make build_userspace
|
|
|
|
- name: Perform CodeQL Analysis
|
|
uses: github/codeql-action/analyze@v3
|
|
with:
|
|
category: "/language:${{matrix.language}}"
|
|
|
|
compile:
|
|
name: Build OS
|
|
runs-on: ubuntu-latest
|
|
needs: [buildcompiler]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
fetch-depth: 0
|
|
|
|
- name: Cache cross Folder
|
|
id: cache-cross
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: tools/cross
|
|
key: ${{ runner.os }}-cross-${{ hashFiles('tools/Makefile') }}
|
|
|
|
- name: Prepare Environment for Dev Container
|
|
run: |
|
|
sudo mkdir -p /tmp/.X11-unix
|
|
sudo mkdir -p /run/user/1000/pulse
|
|
sudo touch /tmp/.Xauthority
|
|
sudo touch /run/user/1000/pulse/native
|
|
echo "XAUTHORITY=/tmp/.Xauthority" >> $GITHUB_ENV
|
|
|
|
- name: Build AMD64 Debug
|
|
if: always()
|
|
uses: devcontainers/ci@v0.3
|
|
with:
|
|
push: never
|
|
runCmd: /usr/bin/make __ci-amd64-debug
|
|
|
|
- name: Build AMD64 Release
|
|
if: always()
|
|
uses: devcontainers/ci@v0.3
|
|
with:
|
|
push: never
|
|
runCmd: /usr/bin/make __ci-amd64-release
|
|
|
|
- name: Build i386 Debug
|
|
if: always()
|
|
uses: devcontainers/ci@v0.3
|
|
with:
|
|
push: never
|
|
runCmd: /usr/bin/make __ci-i386-debug
|
|
|
|
- name: Build i386 Release
|
|
if: always()
|
|
uses: devcontainers/ci@v0.3
|
|
with:
|
|
push: never
|
|
runCmd: /usr/bin/make __ci-i386-release
|
|
|
|
- name: Build ARM Debug
|
|
if: always()
|
|
uses: devcontainers/ci@v0.3
|
|
with:
|
|
push: never
|
|
runCmd: /usr/bin/make __ci-arm-debug
|
|
|
|
- name: Build ARM Release
|
|
if: always()
|
|
uses: devcontainers/ci@v0.3
|
|
with:
|
|
push: never
|
|
runCmd: /usr/bin/make __ci-arm-release
|
|
|
|
- name: Build AArch64 Debug
|
|
if: always()
|
|
uses: devcontainers/ci@v0.3
|
|
with:
|
|
push: never
|
|
runCmd: /usr/bin/make __ci-aarch64-debug
|
|
|
|
- name: Build AArch64 Release
|
|
if: always()
|
|
uses: devcontainers/ci@v0.3
|
|
with:
|
|
push: never
|
|
runCmd: /usr/bin/make __ci-aarch64-release
|
|
|
|
- name: Build Prepare Archive
|
|
if: always()
|
|
uses: devcontainers/ci@v0.3
|
|
with:
|
|
push: never
|
|
runCmd: /usr/bin/make __ci-prepare-archive
|
|
|
|
- name: Upload Artifact
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Fennix
|
|
path: artifacts/
|