diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 912630c115..77ab3dfa24 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -8,14 +8,16 @@ on: - trying pull_request: +env: + CARGO_TERM_COLOR: always + jobs: clippy: name: Clippy runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: hermitcore/toolchain@downstream - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings + - name: Rustup (apply rust-toolchain.toml) + run: rustup show + - name: Clippy + run: cargo clippy -- -D warnings diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index cab2d18de6..a3088c21d2 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -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 + clippy: + 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.3.4 - - name: Check Formatting + - uses: actions/checkout@v2 + - name: Rustup (apply rust-toolchain.toml) + run: rustup show + - name: Format run: cargo fmt -- --check diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml deleted file mode 100644 index c15b51be22..0000000000 --- a/.github/workflows/nightly.yml +++ /dev/null @@ -1,129 +0,0 @@ -name: Tests (nightly) - -on: - pull_request: - push: - branches: - - master - - staging - - trying - -jobs: - build: - name: Tests - 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' - - - steps: - - uses: hecrj/setup-rust-action@v1 - with: - rust-version: ${{ matrix.rust }} - components: ${{ matrix.components || '' }} - targets: ${{ matrix.targets || '' }} - - name: Checkout rusty-hermit - uses: actions/checkout@v2.3.4 - with: - repository: 'hermitcore/rusty-hermit' - ref: 'master' - submodules: 'true' - - name: Remove submodule libhermit-rs - run: rm -r libhermit-rs - if: ${{ ( matrix.os == 'macOS-latest' ) || ( matrix.os == 'ubuntu-latest' ) }} - - name: Remove submodule libhermit-rs (windows) - run: git rm -r libhermit-rs - if: ${{ matrix.os == 'windows-latest' }} - - name: Checkout - uses: actions/checkout@v2.3.4 - with: - path: 'libhermit-rs' - - name: Check Cargo availability - run: cargo --version - - name: Cargo Test libhermit-rs (Unittests on Host) - run: cargo test --lib --target x86_64-unknown-linux-gnu - working-directory: libhermit-rs - if: ${{ matrix.os == 'ubuntu-latest' }} - - 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' }} - # Note: The add-path must be kept in sync with the version of binutils installed by homebrew - - name: Install qemu/nasm (macos) - run: | - brew install qemu nasm - if: ${{ matrix.os == 'macOS-latest' }} - - name: Install nasm (windows) - uses: crazy-max/ghaction-chocolatey@v1.5.0 - with: - args: install nasm - if: ${{ matrix.os == 'windows-latest' }} - # Note: force version to 2020.08.14, as the november version seems to be broken. - - name: Install qemu (windows) - uses: crazy-max/ghaction-chocolatey@v1.5.0 - with: - args: install qemu --version=2020.08.14 - if: ${{ matrix.os == 'windows-latest' }} - # Note: The november release of qemu installs into 'C:\Program Files (x86)' by default, so keep that in mind when updating qemu - - 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 minimal kernel - working-directory: libhermit-rs - run: - cargo build -Z build-std=core,alloc --target x86_64-unknown-none-hermitkernel --no-default-features - - name: Building dev version - run: - cargo build -Z build-std=std,core,alloc,panic_abort --target x86_64-unknown-hermit - - name: Building release version - run: - cargo build -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 128M -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 - - name: Test release version - run: - qemu-system-x86_64 -display none -smp 1 -m 128M -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 - - name: Integration Tests - working-directory: libhermit-rs - run: - cargo test --tests --no-fail-fast -Z build-std=core,alloc --target x86_64-unknown-none-hermitkernel -- --bootloader_path=../loader/target/x86_64-unknown-hermit-loader/debug/rusty-loader - continue-on-error: true - if: ${{ matrix.os == 'ubuntu-latest' }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish_docs.yml similarity index 62% rename from .github/workflows/publish.yml rename to .github/workflows/publish_docs.yml index ab9e4ceead..82aba1c104 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish_docs.yml @@ -1,31 +1,23 @@ -name: Build docs +name: Publish Docs on: push: branches: - master +env: + CARGO_TERM_COLOR: always + jobs: publish: - runs-on: ubuntu-latest - steps: - name: Checkout code - uses: actions/checkout@v2.3.4 - with: - submodules: true - - name: Install nightly toolchain - uses: actions-rs/toolchain@v1.0.7 - with: - toolchain: nightly - components: rust-src - override: true + uses: actions/checkout@v2 + - name: Rustup (apply rust-toolchain.toml) + run: rustup show - name: Generate documentation - uses: actions-rs/cargo@v1.0.3 - with: - command: doc - args: -Z build-std=core,alloc,panic_abort -Z build-std-features=compiler-builtins-mem --target x86_64-unknown-hermit-kernel.json + run: cargo doc - name: Generate index.html run: | cat > target/x86_64-unknown-hermit-kernel/doc/index.html <> $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,fxsr \ + -kernel loader/target/x86_64-unknown-hermit-loader/release/rusty-loader \ + -initrd target/x86_64-unknown-hermit/debug/rusty_demo + - name: Integration tests (ubuntu) + working-directory: libhermit-rs + if: ${{ matrix.os == 'ubuntu-latest' }} + run: cargo test --tests --no-fail-fast -- --bootloader_path=../loader/target/x86_64-unknown-hermit-loader/release/rusty-loader + continue-on-error: true + - name: Build release profile + run: cargo build --release + - name: Test release profile + run: | + qemu-system-x86_64 -display none -smp 1 -m 128M -serial stdio \ + -cpu qemu64,apic,fsgsbase,rdtscp,xsave,fxsr \ + -kernel loader/target/x86_64-unknown-hermit-loader/release/rusty-loader \ + -initrd target/x86_64-unknown-hermit/release/rusty_demo diff --git a/bors.toml b/bors.toml index de768e1a25..5106920961 100644 --- a/bors.toml +++ b/bors.toml @@ -1,8 +1,8 @@ status = [ - "Tests (macOS-latest, nightly)", - "Tests (windows-latest, nightly)", - "Tests (ubuntu-latest, nightly)", - "Format check (ubuntu-latest, nightly)", + "Test (ubuntu-latest)", + "Test (macos-latest)", + "Test (windows-latest)", + "Format", "Clippy", "ci/gitlab/git.rwth-aachen.de", ]