diff --git a/.github/workflows/dockerBuild.yml b/.github/workflows/dockerBuild.yml index e71198e..51cdde8 100644 --- a/.github/workflows/dockerBuild.yml +++ b/.github/workflows/dockerBuild.yml @@ -5,13 +5,13 @@ on: branches: - "*" pull_request: - branches: [ "master" ] + branches: ["master"] workflow_dispatch: jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag anotheros:$(date +%s) + - uses: actions/checkout@v4 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag anotheros:$(date +%s) diff --git a/.github/workflows/dockerPublish.yml b/.github/workflows/dockerPublish.yml index 3d19043..a122e5a 100644 --- a/.github/workflows/dockerPublish.yml +++ b/.github/workflows/dockerPublish.yml @@ -7,13 +7,13 @@ name: Docker Image CD on: schedule: - - cron: '43 11 * * *' + - cron: "43 11 * * *" push: - branches: [ "master"] + branches: ["master"] # Publish semver tags as releases. - tags: [ 'v*.*.*' ] + tags: ["v*.*.*"] pull_request: - branches: [ "master" ] + branches: ["master"] workflow_dispatch: env: @@ -22,7 +22,6 @@ env: # github.repository as / IMAGE_NAME: ${{ github.repository }} - jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/rustBuildCI.yml b/.github/workflows/rustBuildCI.yml index 1a6d933..f8ca940 100644 --- a/.github/workflows/rustBuildCI.yml +++ b/.github/workflows/rustBuildCI.yml @@ -14,17 +14,26 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - - name: Install Rust - run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile complete --default-toolchain stable + - name: Install Rust + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile complete --default-toolchain stable - - name: Setup env - run: . "$HOME/.cargo/env" - - name: Setup System - run: sudo apt update && sudo apt install gcc clang qemu-utils qemu-system-x86 qemu-system-gui cmake make -y + - name: Setup env + run: . "$HOME/.cargo/env" + - name: Setup System + run: sudo apt update && sudo apt install gcc clang qemu-utils qemu-system-x86 qemu-system-gui cmake make -y - - name: Build with Cargo - run: rustup override set nightly && rustup target add x86_64-unknown-none && rustup component add rust-src && rustup component add llvm-tools && cargo build + - name: Build with Cargo + run: rustup override set nightly && rustup target add x86_64-unknown-none && rustup component add rust-src && rustup component add llvm-tools && cargo build + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: build-artifact + path: . + retention-days: 90 + if-no-files-found: error + compression-level: 0 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..debda71 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +uefi.img +bios.img +xauth.txt \ No newline at end of file diff --git a/build.rs b/build.rs index b380778..6ae4cc6 100644 --- a/build.rs +++ b/build.rs @@ -15,6 +15,13 @@ fn main() { let bios_path = out_dir.join("bios.img"); bootloader::BiosBoot::new(&kernel).create_disk_image(&bios_path).unwrap(); + // create local disk images for testing + let current_dir = std::env::current_dir().unwrap(); + let local_uefi_path = current_dir.join("uefi.img"); + bootloader::UefiBoot::new(&kernel).create_disk_image(&local_uefi_path).unwrap(); + let local_bios_path = current_dir.join("bios.img"); + bootloader::BiosBoot::new(&kernel).create_disk_image(&local_bios_path).unwrap(); + // pass the disk image paths as env variables to the `main.rs` println!("cargo:rustc-env=UEFI_PATH={}", uefi_path.display()); println!("cargo:rustc-env=BIOS_PATH={}", bios_path.display());