Skip to content

Shutdown/Reboot

Shutdown/Reboot #337

Workflow file for this run

# We could use `@actions-rs/cargo` Action ability to automatically install `cross` tool
# in order to compile our application for some unusual targets.
on:
push:
branches: [master]
pull_request:
branches: [master]
name: OS Build checks
jobs:
kernel:
name: Kernel
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: >
sudo apt update -y &&
sudo apt install -y xorriso mtools grub-pc-bin qemu-system-x86
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-01-04
components: rust-src, rustfmt, clippy
- name: Kernel check
run: |
cargo xtask kernel fmt -- --all --check
cargo xtask kernel clippy -- --all-targets -- -D warnings
- run: cargo xtask test
- run: cargo xtask --release build-iso
- name: Upload kernel artifact
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: kernel
path: target/release/kernel.iso
overwrite: true
toolchain:
name: Toolchain
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: >
sudo apt update -y &&
sudo apt install -y ninja-build
# Checkout the repository without submodules, we will do it manually
- uses: actions/checkout@v4
with:
submodules: 'false'
- name: Get submodule hash
id: submodule-hash
run: echo "hash=$(git ls-tree HEAD extern/rust | awk '{print $3}')" >> $GITHUB_OUTPUT
- name: Restore cached rust build
id: cache-os-rust-restore
uses: actions/cache/restore@v4
with:
key: rust-${{ steps.submodule-hash.outputs.hash }}
path: /tmp/dist
# run after this if something changed, otherwise skip all
- uses: actions-rs/toolchain@v1
if: steps.cache-os-rust-restore.outputs.cache-hit != 'true'
with:
toolchain: nightly-2024-01-04
components: rust-src
# Fetch only top level submodules without recursive
# building the toolchain will automatically fetch the children of `rust`
# 100 so that we can get at least a single `upstream` commit, for llvm-ci cache to work
- name: submodule fetch bare
if: steps.cache-os-rust-restore.outputs.cache-hit != 'true'
run: git submodule update --init --depth 100
- run: cargo xtask toolchain -o /tmp/dist
if: steps.cache-os-rust-restore.outputs.cache-hit != 'true'
- name: Save cache toolchain
id: cache-os-rust-save
uses: actions/cache/save@v4
if: steps.cache-os-rust-restore.outputs.cache-hit != 'true'
with:
path: /tmp/dist
key: ${{ steps.cache-os-rust-restore.outputs.cache-primary-key }}
- name: Upload toolchain artifact
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: toolchain
path: /tmp/dist
overwrite: true
filesystem:
name: Filesystem
needs: toolchain
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-01-04
components: rust-src
- name: Get submodule hash
id: submodule-hash
run: echo "hash=$(git ls-tree HEAD extern/rust | awk '{print $3}')" >> $GITHUB_OUTPUT
- name: Restore cached rust build
id: cache-os-rust-restore
uses: actions/cache/restore@v4
with:
path: /tmp/dist
key: rust-${{ steps.submodule-hash.outputs.hash }}
fail-on-cache-miss: true
- name: install toolchain
run: bash tools/install_toolchain_and_link.sh /tmp/dist
- name: Userspace check
run: |
cargo xtask userspace fmt -- --check
# disable for now, as some warnings in `emerald_std` to be fixed later
# cargo xtask userspace clippy -- -- -D warnings
- run: cargo xtask --release userspace build
env:
USE_INSTALLED_TOOLCHAIN: true
- name: Upload filesystem artifact
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: filesystem_programs
path: filesystem
overwrite: true