Skip to content

Commit

Permalink
Merge #179
Browse files Browse the repository at this point in the history
179: Rework CI r=jounathaen a=mkroening

Started in #177

This simplifies the rust toolchain setup in our CI and removes a duplicated test.

Co-authored-by: Martin Kröning <mkroening@posteo.net>
  • Loading branch information
bors[bot] and mkroening committed Sep 1, 2021
2 parents cd2e0b6 + bd427c1 commit 6ff81f4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 130 deletions.
36 changes: 10 additions & 26 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Format check
name: Format

on:
pull_request:
Expand All @@ -8,31 +8,15 @@ on:
- trying

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
run: cargo fmt -- --check
- name: Check Integration Test Formatting
- uses: actions/checkout@v2
- name: Install toolchain from rust-toolchain.toml
run: rustup show
- name: Format
run: cargo fmt --all -- --check
- name: Integration Test Format
working-directory: ./tests/test-kernels
run: cargo fmt -- --check
run: cargo fmt --all -- --check
38 changes: 5 additions & 33 deletions .github/workflows/kvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,12 @@ jobs:
kvm:
name: KVM Tests
runs-on: [self-hosted]

steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
components: 'rustfmt, clippy'
targets: 'x86_64-unknown-linux-gnu'
- uses: actions/checkout@v2
with:
submodules: true
- name: Check Cargo availability
run: cargo --version
- name: Install toolchain from rust-toolchain.toml
run: rustup show
- name: Build (debug)
run:
cargo build
- name: Build (release)
run:
cargo build --release
run: cargo build
- name: Prepare test environment
shell: bash
run: |
Expand All @@ -44,28 +32,12 @@ jobs:
cd ../rusty-hermit
cargo build -p rusty_demo
RUST_LOG=debug $GITHUB_WORKSPACE/target/debug/uhyve -v -c 1 target/x86_64-unknown-hermit/debug/rusty_demo
- name: Build (release)
run: cargo build --release
- name: KVM tests (release)
shell: bash
run: |
cd $GITHUB_WORKSPACE
cd ../rusty-hermit
cargo build -p rusty_demo --release
RUST_LOG=debug $GITHUB_WORKSPACE/target/release/uhyve -v -c 1 target/x86_64-unknown-hermit/release/rusty_demo
kernel-tests:
name: Rusty-Hermit Kernel Tests
runs-on: [self-hosted]

steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
components: 'rustfmt, clippy'
targets: 'x86_64-unknown-linux-gnu'
- uses: actions/checkout@v2
with:
submodules: true
- name: Check Cargo availability
run: cargo --version
- name: Integration Tests
run: cargo test --test '*'
77 changes: 12 additions & 65 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,13 @@ jobs:
test:
name: Cargo tests
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest,macOS-latest]
rust: [nightly]
include:
- os: macOS-latest
rust: 'nightly'
components: 'rustfmt, clippy, rust-src'
targets: 'x86_64-apple-darwin'
- os: ubuntu-latest
rust: 'nightly'
components: 'rustfmt, clippy'
targets: 'x86_64-unknown-linux-musl'


os: [ubuntu-latest, macos-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
fetch-depth: '0'
- name: Check Cargo availability
run: cargo --version
- name: Install toolchain from rust-toolchain.toml
run: rustup show
- name: Test
run: |
cargo test --lib -- --nocapture --skip test_vm
Expand All @@ -49,63 +28,31 @@ jobs:
build:
name: Build
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest,macOS-latest]
rust: [nightly]
include:
- os: macOS-latest
rust: 'nightly'
components: 'rustfmt, clippy, rust-src'
targets: 'x86_64-apple-darwin'
- os: ubuntu-latest
rust: 'nightly'
components: 'rustfmt, clippy'
targets: 'x86_64-unknown-linux-musl'


os: [ubuntu-latest, macos-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 toolchain from rust-toolchain.toml
run: rustup show
- name: Build
run:
cargo build
run: cargo build
- name: Build with instrument feature
run:
cargo clean && RUSTFLAGS="-Z instrument-mcount" cargo build
run: cargo clean && RUSTFLAGS="-Z instrument-mcount" cargo build
- name: Compile, but don't run benchmarks
run:
cargo bench --no-run
run: cargo bench --no-run

kernel-tests:
name: Rusty-Hermit Kernel based integration tests
runs-on: [self-hosted]

steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
components: 'rustfmt, clippy'
targets: 'x86_64-unknown-linux-gnu'
- uses: actions/checkout@v2
with:
submodules: true
- name: Check Cargo availability
run: cargo --version
- name: Install toolchain from rust-toolchain.toml
run: rustup show
- name: Integration Tests
run: cargo test --test '*'
- name: Generate integration test coverage
run: |
./generate_test_coverage.sh --print-coverage
run: ./generate_test_coverage.sh --print-coverage
- name: Generate unit test coverage
run: |
#./generate_test_coverage.sh --print-coverage
Expand Down
11 changes: 5 additions & 6 deletions bors.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
status = [
"Build (macOS-latest, nightly)",
"Build (ubuntu-latest, nightly)",
"Cargo tests (macOS-latest, nightly)",
"Cargo tests (ubuntu-latest, nightly)",
"Build (macos-latest)",
"Build (ubuntu-latest)",
"Cargo tests (macos-latest)",
"Cargo tests (ubuntu-latest)",
"Clippy",
"Format check (ubuntu-latest, nightly)",
"Format",
"KVM Tests",
"Rusty-Hermit Kernel based integration tests",
"Rusty-Hermit Kernel Tests",
]
delete_merged_branches = true
timeout_sec = 7200

0 comments on commit 6ff81f4

Please sign in to comment.