2020-03-12 12:13:08 -05:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2020-03-12 12:48:28 -05:00
|
|
|
- "master"
|
2020-03-14 22:57:01 -05:00
|
|
|
- "develop"
|
2020-03-12 12:13:08 -05:00
|
|
|
tags:
|
2020-03-12 12:48:28 -05:00
|
|
|
- "*"
|
2020-03-12 12:13:08 -05:00
|
|
|
schedule:
|
2020-03-12 12:48:28 -05:00
|
|
|
- cron: "40 4 * * *" # every day at 4:40
|
2020-03-12 12:13:08 -05:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
name: "Test"
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-03-12 12:48:28 -05:00
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2020-03-12 12:13:08 -05:00
|
|
|
|
2020-03-12 12:48:28 -05:00
|
|
|
runs-on: ${{ matrix.os }}
|
2020-03-12 12:13:08 -05:00
|
|
|
timeout-minutes: 15
|
|
|
|
|
|
|
|
steps:
|
2020-03-12 12:48:28 -05:00
|
|
|
- name: "Checkout Repository"
|
|
|
|
uses: actions/checkout@v1
|
2020-03-12 12:13:08 -05:00
|
|
|
|
2020-03-12 12:48:28 -05:00
|
|
|
- name: Install Rustup
|
|
|
|
run: |
|
|
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
|
2021-02-14 21:06:06 -06:00
|
|
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
2020-03-12 12:48:28 -05:00
|
|
|
if: runner.os == 'macOS'
|
2020-03-12 12:13:08 -05:00
|
|
|
|
2020-03-12 12:48:28 -05:00
|
|
|
- name: "Print Rust Version"
|
|
|
|
run: |
|
|
|
|
rustc -Vv
|
|
|
|
cargo -Vv
|
2020-03-12 15:49:35 -05:00
|
|
|
- name: Cache binaries
|
|
|
|
id: cache-bin
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: binaries
|
|
|
|
key: ${{ runner.OS }}-binaries
|
|
|
|
- name: Add binaries/bin to PATH
|
2021-02-14 21:06:06 -06:00
|
|
|
run: echo "$GITHUB_WORKSPACE/binaries/bin" >> $GITHUB_PATH
|
2020-03-12 15:49:35 -05:00
|
|
|
shell: bash
|
|
|
|
|
2020-03-12 12:48:28 -05:00
|
|
|
- name: "Run cargo build"
|
|
|
|
run: cargo build
|
2020-03-12 12:13:08 -05:00
|
|
|
|
2020-03-12 12:48:28 -05:00
|
|
|
- name: "Run cargo test"
|
|
|
|
run: cargo test
|
2020-03-12 12:13:08 -05:00
|
|
|
|
2020-03-12 12:48:28 -05:00
|
|
|
- name: "Install Rustup Components"
|
|
|
|
run: rustup component add rust-src llvm-tools-preview
|
|
|
|
- name: "Install cargo-xbuild"
|
2020-03-12 15:49:35 -05:00
|
|
|
run: cargo install cargo-xbuild --debug --root binaries
|
2020-03-12 12:48:28 -05:00
|
|
|
- name: "Install bootimage"
|
2020-03-12 15:49:35 -05:00
|
|
|
run: cargo install bootimage --debug --root binaries
|
2020-03-12 12:48:28 -05:00
|
|
|
|
2020-03-12 15:49:35 -05:00
|
|
|
# install QEMU
|
2020-03-12 12:48:28 -05:00
|
|
|
- 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 Scoop (Windows)
|
|
|
|
run: |
|
|
|
|
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
|
2021-02-14 21:06:06 -06:00
|
|
|
echo "$HOME\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
2020-03-12 12:48:28 -05:00
|
|
|
if: runner.os == 'Windows'
|
|
|
|
shell: pwsh
|
|
|
|
- name: Install QEMU (Windows)
|
|
|
|
run: scoop install qemu
|
|
|
|
if: runner.os == 'Windows'
|
|
|
|
shell: pwsh
|
|
|
|
|
|
|
|
- name: "Print QEMU Version"
|
|
|
|
run: qemu-system-x86_64 --version
|
2020-03-14 22:57:01 -05:00
|
|
|
|
2020-03-12 16:43:04 -05:00
|
|
|
- name: "Build Test Kernel"
|
|
|
|
run: cargo xbuild
|
2020-03-14 22:57:01 -05:00
|
|
|
working-directory: "testing"
|
2020-03-12 12:48:28 -05:00
|
|
|
|
2020-03-13 10:45:40 -05:00
|
|
|
- name: "Run Test Framework"
|
|
|
|
run: cargo xtest --verbose
|
|
|
|
working-directory: "testing"
|
|
|
|
|
2020-03-12 12:13:08 -05:00
|
|
|
check_formatting:
|
|
|
|
name: "Check Formatting"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 2
|
|
|
|
steps:
|
2020-03-12 12:48:28 -05:00
|
|
|
- uses: actions/checkout@v1
|
2020-04-08 22:34:16 -05:00
|
|
|
- run: rustup toolchain install nightly --profile minimal --component rustfmt
|
2020-03-12 12:48:28 -05:00
|
|
|
- run: cargo +nightly fmt -- --check
|
|
|
|
|
|
|
|
clippy:
|
|
|
|
name: "Clippy"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2020-04-08 22:35:51 -05:00
|
|
|
- run: rustup toolchain install nightly --profile minimal --component clippy
|
2020-03-12 12:48:28 -05:00
|
|
|
- run: cargo +nightly clippy -- -D warnings
|