Skip to content

Commit

Permalink
Merge pull request #2 from hermitcore/master
Browse files Browse the repository at this point in the history
Pull hermitcore master to my fork
  • Loading branch information
PJungkamp committed Sep 28, 2021
2 parents dc57117 + e405b37 commit a626e9f
Show file tree
Hide file tree
Showing 41 changed files with 1,081 additions and 856 deletions.
File renamed without changes.
25 changes: 25 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Clippy

on:
push:
branches:
- master
- staging
- trying
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Rustup (apply rust-toolchain.toml)
run: rustup show
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
35 changes: 11 additions & 24 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,23 @@
name: Format check
name: Format

on:
pull_request:
push:
branches:
- master
- staging
- trying
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
check:
name: Format check
format:
name: Format
runs-on: ubuntu-latest

strategy:
matrix:
os: [ubuntu-latest]
rust: [nightly]
include:
- os: ubuntu-latest
rust: 'nightly'
components: 'rustfmt'
targets: 'x86_64-unknown-linux-gnu'


steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
components: ${{ matrix.components || '' }}
targets: ${{ matrix.targets || '' }}
- name: Checkout
uses: actions/checkout@v2
- name: Check Formatting
- uses: actions/checkout@v2
- name: Rustup (apply rust-toolchain.toml)
run: rustup show
- name: Format
run: cargo fmt -- --check
43 changes: 43 additions & 0 deletions .github/workflows/kvm_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: KVM Test

on:
push:
branches:
- master
- staging
- trying
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
kvm_test:
name: KVM Test
runs-on: [self-hosted]

steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Rustup (apply rust-toolchain.toml)
run: rustup show
- name: Build dev profile
run: cargo build --package rusty_demo
- name: Install uhyve
run: cargo install uhyve --locked
- name: Check KVM availability
shell: bash
run: |
lscpu
kvm-ok
- name: Test debug version
run: uhyve --verbose --cpus 1 target/x86_64-unknown-hermit/debug/rusty_demo
env:
RUST_LOG: debug
- name: Build release profile
run: cargo build --package rusty_demo --release
- name: Test release version
run: uhyve --verbose --cpus 1 target/x86_64-unknown-hermit/release/rusty_demo
env:
RUST_LOG: debug
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
name: Build docs
name: Publish Docs

on:
push:
branches:
- master

jobs:
publish:
runs-on: ubuntu-18.04 # linux required if you want to use docker
container:
image: registry.git.rwth-aachen.de/acs/public/hermitcore/hermitrust
env:
CARGO_TERM_COLOR: always

jobs:
publish_docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
submodules: true
- name: Rustup (apply rust-toolchain.toml)
run: rustup show
- name: Generate documentation
uses: actions-rs/cargo@v1
with:
command: doc
args: --workspace -Z build-std=std,core,alloc,panic_abort --target x86_64-unknown-hermit
run: cargo doc
- name: Generate index.html
run: |
cat > target/x86_64-unknown-hermit/doc/index.html <<EOL
Expand All @@ -42,4 +41,4 @@ jobs:
target_branch: gh-pages
build_dir: target/x86_64-unknown-hermit/doc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
147 changes: 57 additions & 90 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,106 +1,73 @@
name: Build and test
name: Test

on:
pull_request:
push:
branches:
- master
- staging
- trying
schedule:
- cron: '0 0 * * 6'
pull_request:

env:
CARGO_TERM_COLOR: always

defaults:
run:
shell: bash

jobs:
build:
name: Test
runs-on: ${{ matrix.os }}
# these tests based on the nightly compiler, which can be broken
# consequently, we continue on an error
#continue-on-error: true

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [nightly]
include:
- os: macOS-latest
rust: 'nightly'
components: 'rust-src, llvm-tools-preview'
targets: 'x86_64-apple-darwin'
- os: windows-latest
rust: 'nightly'
components: 'rust-src, llvm-tools-preview'
targets: 'x86_64-pc-windows-msvc'
- os: ubuntu-latest
rust: 'nightly'
components: 'rust-src, llvm-tools-preview'
targets: 'x86_64-unknown-linux-gnu'

os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
components: ${{ matrix.components || '' }}
targets: ${{ matrix.targets || '' }}
- uses: actions/checkout@v2
with:
submodules: true
- name: Check Cargo availability
run: cargo --version
- name: Install qemu/nasm (apt)
run: sudo apt-get update --fix-missing && sudo apt-get install qemu-system-x86 nasm
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Install qemu/nasm (macos)
run: |
- uses: actions/checkout@v2
with:
submodules: true
- name: Rustup (apply rust-toolchain.toml)
run: rustup show
- name: Build dev profile
run: cargo build --package rusty_demo
- name: Install QEMU, NASM (ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get install qemu-system-x86 nasm
- name: Install QEMU, NASM (macos)
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew update
brew install qemu nasm
if: ${{ matrix.os == 'macOS-latest' }}
- name: Install nasm (windows)
uses: crazy-max/ghaction-chocolatey@v1
with:
args: install nasm
if: ${{ matrix.os == 'windows-latest' }}
- name: Install qemu (windows)
uses: crazy-max/ghaction-chocolatey@v1
with:
args: install qemu --version=2020.08.14
if: ${{ matrix.os == 'windows-latest' }}
- name: Set path to qemu/nasm (Windows)
run: |
echo "C:\Program Files\qemu" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Program Files\nasm" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
if: ${{ matrix.os == 'windows-latest' }}
- name: Building dev version
run:
cargo build -p rusty_demo -Z build-std=std,core,alloc,panic_abort --target x86_64-unknown-hermit
- name: Building release version
run:
cargo build -p rusty_demo -Z build-std=std,core,alloc,panic_abort --target x86_64-unknown-hermit --release
env:
RUSTFLAGS: -Clinker-plugin-lto
- name: Build loader (unix)
working-directory: loader
run: make
if: ${{ ( matrix.os == 'macOS-latest' ) || ( matrix.os == 'ubuntu-latest' ) }}
# Workaround since makefile doesn't work when using powershell
- name: Build loader (windows)
working-directory: loader
run: |
cargo build -Z build-std=core,alloc --target x86_64-unknown-hermit-loader.json
$VAR_RUSTC_SYSROOT = (rustc --print sysroot)
echo "Sysroot - $VAR_RUSTC_SYSROOT"
$LLVM_OBJCOPY = ((Get-ChildItem -Path $VAR_RUSTC_SYSROOT -Include llvm-objcopy.exe -File -Recurse -ErrorAction SilentlyContinue)).Fullname
echo "LLVM Objcopy - $LLVM_OBJCOPY"
Invoke-Expression "$LLVM_OBJCOPY --strip-debug -O elf32-i386 target/x86_64-unknown-hermit-loader/debug/rusty-loader"
if: ${{ matrix.os == 'windows-latest' }}
- name: Test dev version
run:
qemu-system-x86_64 -display none -smp 1 -m 64M -serial stdio -kernel loader/target/x86_64-unknown-hermit-loader/debug/rusty-loader -initrd target/x86_64-unknown-hermit/debug/rusty_demo -cpu qemu64,apic,fsgsbase,rdtscp,xsave,fxsr,rdrand
- name: Test release version
run:
qemu-system-x86_64 -display none -smp 1 -m 64M -serial stdio -kernel loader/target/x86_64-unknown-hermit-loader/debug/rusty-loader -initrd target/x86_64-unknown-hermit/release/rusty_demo -cpu qemu64,apic,fsgsbase,rdtscp,xsave,fxsr,rdrand
- name: Build httpd with DHCP support
run:
cargo build --manifest-path examples/httpd/Cargo.toml --features dhcpv4
- name: Build httpd without DHCP support
run:
cargo build --manifest-path examples/httpd/Cargo.toml
- name: Install QEMU, NASM, GNU make (windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
choco install qemu nasm make
echo "C:\Program Files\qemu" >> $GITHUB_PATH
echo "C:\Program Files\NASM" >> $GITHUB_PATH
- name: Build loader
run: |
sed -i.old 's/OBJCOPY := $(shell find $(SYSROOT) -name llvm-objcopy)/OBJCOPY := $(shell find $(SYSROOT) -name llvm-objcopy -o -name llvm-objcopy.exe)/g' loader/Makefile
make -C loader release=1
- name: Test dev profile
run: |
qemu-system-x86_64 -display none -smp 1 -m 128M -serial stdio \
-cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand \
-kernel loader/target/x86_64-unknown-hermit-loader/release/rusty-loader \
-initrd target/x86_64-unknown-hermit/debug/rusty_demo
- name: Build release profile
run:
cargo build --package rusty_demo --release
- name: Test release profile
run: |
qemu-system-x86_64 -display none -smp 1 -m 128M -serial stdio \
-cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand \
-kernel loader/target/x86_64-unknown-hermit-loader/release/rusty-loader \
-initrd target/x86_64-unknown-hermit/release/rusty_demo
- name: Build httpd with DHCP support
run:
cargo build --package httpd --features dhcpv4
- name: Build httpd without DHCP support
run:
cargo build --package httpd

0 comments on commit a626e9f

Please sign in to comment.