Build #1195
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- "master" | |
- "develop" | |
tags: | |
- "*" | |
schedule: | |
- cron: "40 4 * * *" # every day at 4:40 | |
pull_request: | |
jobs: | |
test: | |
name: "Test" | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 15 | |
steps: | |
- name: "Checkout Repository" | |
uses: actions/checkout@v1 | |
- name: Install Rustup | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
if: runner.os == 'macOS' | |
- name: "Print Rust Version" | |
run: | | |
rustc -Vv | |
cargo -Vv | |
- name: Cache binaries | |
id: cache-bin | |
uses: actions/cache@v1 | |
with: | |
path: binaries | |
key: ${{ runner.OS }}-binaries | |
- name: Add binaries/bin to PATH | |
run: echo "$GITHUB_WORKSPACE/binaries/bin" >> $GITHUB_PATH | |
shell: bash | |
- name: "Run cargo build" | |
run: cargo build | |
- name: "Run cargo test" | |
run: cargo test | |
- name: "Install Rustup Components" | |
run: rustup component add rust-src llvm-tools-preview | |
- name: "Install cargo-xbuild" | |
run: cargo install cargo-xbuild --debug --root binaries | |
- name: "Install bootimage" | |
run: cargo install bootimage --debug --root binaries | |
# install QEMU | |
- name: Install QEMU (Linux) | |
run: | | |
sudo apt update | |
sudo apt install qemu-system-x86 | |
if: runner.os == 'Linux' | |
- name: Install QEMU (macOS) | |
run: brew install qemu | |
if: runner.os == 'macOS' | |
env: | |
HOMEBREW_NO_AUTO_UPDATE: 1 | |
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: 1 | |
HOMEBREW_NO_INSTALL_CLEANUP: 1 | |
- name: Install QEMU (Windows) | |
run: | | |
choco install qemu --version 2021.5.5 | |
echo "$Env:Programfiles\qemu" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
if: runner.os == 'Windows' | |
shell: pwsh | |
- name: "Print QEMU Version" | |
run: qemu-system-x86_64 --version | |
- name: "Print QEMU Version" | |
run: qemu-system-x86_64 --version | |
- name: "Build Test Kernel" | |
run: cargo xbuild | |
working-directory: "testing" | |
- name: "Run Test Framework" | |
run: cargo xtest --verbose | |
working-directory: "testing" | |
check_formatting: | |
name: "Check Formatting" | |
runs-on: ubuntu-latest | |
timeout-minutes: 2 | |
steps: | |
- uses: actions/checkout@v1 | |
- run: rustup toolchain install nightly --profile minimal --component rustfmt | |
- run: cargo +nightly fmt -- --check | |
clippy: | |
name: "Clippy" | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v1 | |
- run: rustup toolchain install nightly --profile minimal --component clippy | |
- run: cargo +nightly clippy -- -D warnings |