From 94b8cac7801c195c830e20594cf4fdc6c4edea67 Mon Sep 17 00:00:00 2001 From: Ryan Kennedy Date: Thu, 12 Mar 2020 12:48:28 -0500 Subject: [PATCH] Initial workflow setup --- .github/workflows/rust.yml | 114 ++++++++++++++++++++++++++----------- 1 file changed, 81 insertions(+), 33 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 88aba19..a27d155 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -3,11 +3,11 @@ name: Build on: push: branches: - - 'master' + - "master" tags: - - '*' + - "*" schedule: - - cron: '40 4 * * *' # every day at 4:40 + - cron: "40 4 * * *" # every day at 4:40 pull_request: jobs: @@ -16,49 +16,97 @@ jobs: strategy: matrix: - platform: [ - ubuntu-latest, - macos-latest, - windows-latest - ] + os: [ubuntu-latest, macos-latest, windows-latest] - runs-on: ${{ matrix.platform }} + runs-on: ${{ matrix.os }} timeout-minutes: 15 steps: - - name: "Checkout Repository" - uses: actions/checkout@v1 + - 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 ::add-path::$HOME/.cargo/bin - if: runner.os == 'macOS' + - name: Install Rustup + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly + echo ::add-path::$HOME/.cargo/bin + if: runner.os == 'macOS' - - name: Set Rustup profile to minimal - run: rustup set profile minimal + - name: Set Rustup profile to minimal + run: rustup set profile minimal - - name: "Print Rust Version" - run: | - rustc -Vv - cargo -Vv - - name: "Run cargo build" - run: cargo build + - name: "Print Rust Version" + run: | + rustc -Vv + cargo -Vv + - name: "Run cargo build" + run: cargo build - - name: "Run cargo test" - run: cargo test + - name: "Run cargo test" + run: cargo test - - name: "Run cargo doc" - run: cargo doc + - name: "Run cargo doc" + run: cargo doc - - name: 'Deny Warnings' - run: cargo rustc -- -D warnings + - name: "Deny Warnings" + run: cargo build --features deny-warnings + + - name: "Install Rustup Targets" + run: rustup target add i686-unknown-linux-gnu + + - name: "Build on non x86_64 platforms" + run: cargo build --target i686-unknown-linux-gnu + + - 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 + + - 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') + echo ::add-path::$HOME\scoop\shims + 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 + + - name: "Run Test Framework" + run: cargo xtest + working-directory: "testing" check_formatting: name: "Check Formatting" runs-on: ubuntu-latest timeout-minutes: 2 steps: - - uses: actions/checkout@v1 - - run: rustup install nightly - - run: cargo +nightly fmt -- --check + - uses: actions/checkout@v1 + - run: rustup install nightly + - run: cargo +nightly fmt -- --check + + clippy: + name: "Clippy" + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v1 + - run: rustup install nightly + - run: cargo +nightly clippy -- -D warnings