Skip to content

Commit

Permalink
Merge #142 #143
Browse files Browse the repository at this point in the history
142: Rework CI r=stlankes a=mkroening

I reworked this CI in similar to hermit-os/kernel#230.

143: build.rs improvements r=stlankes a=mkroening

This enables colored output when building hermit via `build.rs` and ensures that build.rs uses the same cargo binary, that it has been invoked with.

Co-authored-by: Martin Kröning <mkroening@posteo.net>
  • Loading branch information
bors[bot] and mkroening committed Jun 26, 2021
3 parents 5b9ecb8 + d1bd548 + 6d4a61e commit 485f8f1
Show file tree
Hide file tree
Showing 8 changed files with 164 additions and 227 deletions.
35 changes: 11 additions & 24 deletions .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
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
44 changes: 0 additions & 44 deletions .github/workflows/kvm.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/kvm_test.yml
@@ -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
61 changes: 0 additions & 61 deletions .github/workflows/publish.yml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/publish_docs.yml
@@ -0,0 +1,44 @@
name: Publish Docs

on:
push:
branches:
- master

env:
CARGO_TERM_COLOR: always

jobs:
publish_docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
- name: Rustup (apply rust-toolchain.toml)
run: rustup show
- name: Generate documentation
run: cargo doc
- name: Generate index.html
run: |
cat > target/x86_64-unknown-hermit/doc/index.html <<EOL
<!doctype html>
<html>
<head>
<title>Redirect!</title>
<meta http-equiv="refresh" content="0; url=https://hermitcore.github.io/rusty-hermit/hermit_abi/" />
</head>
<body>
<p><a href="https://hermitcore.github.io/rusty-hermit/hermit_abi/">Redirect</a></p>
</body>
</html>
EOL
- name: Deploy documentation
if: success()
uses: crazy-max/ghaction-github-pages@v1
with:
target_branch: gh-pages
build_dir: target/x86_64-unknown-hermit/doc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 485f8f1

Please sign in to comment.