Skip to content

Commit

Permalink
Update workflows by adding Upload Artifact and also fixing previous e…
Browse files Browse the repository at this point in the history
…rrors

workflows file are formatted and rustBuildCI has been modified to Upload Artifact.
Syntax error are also corrected.
  • Loading branch information
aelnosu committed May 18, 2024
1 parent cea790c commit 7cf46be
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 21 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/dockerBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
9 changes: 4 additions & 5 deletions .github/workflows/dockerPublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -22,7 +22,6 @@ env:
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}


jobs:
build:
runs-on: ubuntu-latest
Expand Down
31 changes: 20 additions & 11 deletions .github/workflows/rustBuildCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn main() {
bootloader::BiosBoot::new(&kernel).create_disk_image(&bios_path).unwrap();

// create local disk images for testing
let current_dir = env::current_dir().unwrap();
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");
Expand Down

0 comments on commit 7cf46be

Please sign in to comment.