Skip to content

Commit

Permalink
Rewrite CI script with using actions-rs actions
Browse files Browse the repository at this point in the history
This gives use support for github's scoped annotations when there are errors or warnings.
  • Loading branch information
phil-opp committed Jul 16, 2020
1 parent 16ffe80 commit 9c500f9
Showing 1 changed file with 58 additions and 40 deletions.
98 changes: 58 additions & 40 deletions .github/workflows/build-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,59 +12,77 @@ on:
pull_request:

jobs:
test:
name: "Test"

check:
name: Check
strategy:
matrix:
platform: [
ubuntu-latest,
macos-latest,
windows-latest
]

runs-on: ${{ matrix.platform }}
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 ::add-path::$HOME/.cargo/bin
if: runner.os == 'macOS'

- name: "Print Rust Version"
run: |
rustc -Vv
cargo -Vv
- name: "Install Rustup Components"
run: rustup component add rust-src llvm-tools-preview
- name: "Install cargo-xbuild"
run: cargo install cargo-xbuild --debug
- name: "Install bootimage"
run: cargo install bootimage --debug

- name: "Run cargo xbuild"
run: cargo xbuild
- name: "Create Bootimage"
run: cargo bootimage
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
- uses: actions-rs/cargo@v1
with:
command: check

test:
name: Test Suite
runs-on: ubuntu-latest
strategy:
matrix:
platform: [
ubuntu-latest,
macos-latest,
windows-latest
]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
- name: "Install Rustup Components"
run: rustup component add rust-src llvm-tools-preview
- name: "Install bootimage"
run: cargo install bootimage --debug
- uses: actions/checkout@v2
- uses: actions-rs/cargo@v1
with:
command: bootimage

check_formatting:
name: "Check Formatting"
name: Rustfmt
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@v1
- name: "Use the latest Rust nightly with rustfmt"
uses: actions-rs/toolchain@v1
with:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
components: rustfmt
override: true
- run: cargo fmt -- --check
toolchain: nightly
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

0 comments on commit 9c500f9

Please sign in to comment.