Skip to content

Commit

Permalink
Rework CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mkroening committed Jun 15, 2021
1 parent 4cc5195 commit 7bdaffe
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 180 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
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/[email protected]
- name: Check Formatting
- uses: actions/checkout@v2
- name: Rustup (apply rust-toolchain.toml)
run: rustup show
- name: Format
run: cargo fmt -- --check
129 changes: 0 additions & 129 deletions .github/workflows/nightly.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
submodules: true
- name: Install nightly toolchain
uses: actions-rs/[email protected]
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/[email protected]
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 <<EOL
Expand All @@ -42,7 +34,7 @@ jobs:
EOL
- name: Deploy documentation
if: success()
uses: crazy-max/ghaction-github-pages@v2.5.0
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: target/x86_64-unknown-hermit-kernel/doc
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/security_audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v2
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
87 changes: 87 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Test

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

env:
CARGO_TERM_COLOR: always

defaults:
run:
shell: bash

jobs:
build:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout rusty-hermit
uses: actions/checkout@v2
with:
repository: hermitcore/rusty-hermit
submodules: true
- name: Remove libhermit-rs submodule
run: git rm -r libhermit-rs
- name: Checkout libhermit-rs
uses: actions/checkout@v2
with:
path: libhermit-rs
- name: Rustup (apply rust-toolchain.toml)
working-directory: libhermit-rs
run: rustup show
- name: Build minimal kernel
working-directory: libhermit-rs
run: cargo build --no-default-features
- name: Build dev profile
run: cargo build
- name: Unittests on host (ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
working-directory: libhermit-rs
run: cargo test --lib --target x86_64-unknown-linux-gnu
- 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
- 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,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
8 changes: 4 additions & 4 deletions bors.toml
Original file line number Diff line number Diff line change
@@ -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",
]
Expand Down

0 comments on commit 7bdaffe

Please sign in to comment.