github: ci: new

Add CI for checking & building the kernel.
This commit is contained in:
Matthew Leach
2025-11-22 06:00:59 +00:00
parent c306da2d7d
commit 1931880504
4 changed files with 54 additions and 8 deletions

35
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: CI
on:
push:
branches: [ master ]
workflow_dispatch:
pull_request:
branches: [ master ]
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Use the toolchain from rust-toolchain.toml
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Verify installed toolchain and targets
run: |
rustc --version
rustup show
rustup target list --installed
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy -- -D warnings
- name: Run unit tests for libkernel
run: cargo test -p libkernel --target x86_64-unknown-linux-gnu --all-features

View File

@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly"
components = [ "rust-src", "llvm-tools-preview" ]
components = [ "rust-src", "llvm-tools-preview", "rustfmt", "clippy" ]
targets = [ "aarch64-unknown-none-softfloat" ]

View File

@@ -1,7 +1,15 @@
use crate::{fs::VFS, memory::uaccess::{copy_to_user_slice, cstr::UserCStr}, sched::current_task};
use core::{ffi::c_char, str::FromStr};
use crate::{
fs::VFS,
memory::uaccess::{copy_to_user_slice, cstr::UserCStr},
sched::current_task,
};
use alloc::{ffi::CString, string::ToString};
use libkernel::{error::{KernelError, Result}, fs::path::Path, memory::address::{TUA, UA}};
use core::{ffi::c_char, str::FromStr};
use libkernel::{
error::{KernelError, Result},
fs::path::Path,
memory::address::{TUA, UA},
};
pub async fn sys_getcwd(buf: UA, len: usize) -> Result<usize> {
let task = current_task();

View File

@@ -10,11 +10,14 @@ use alloc::{
use creds::Credentials;
use ctx::{Context, UserCtx};
use fd_table::FileDescriptorTable;
use libkernel::{fs::pathbuf::PathBuf, memory::{
address::VA,
proc_vm::{ProcessVM, vmarea::VMArea},
}};
use libkernel::{VirtualMemory, fs::Inode};
use libkernel::{
fs::pathbuf::PathBuf,
memory::{
address::VA,
proc_vm::{ProcessVM, vmarea::VMArea},
},
};
use thread_group::{
Tgid, ThreadGroup,
builder::ThreadGroupBuilder,