Rewrite CI script with using actions-rs actions

This gives use support for github's scoped annotations when there are errors or warnings.
This commit is contained in:
Philipp Oppermann
2020-07-16 16:20:14 +02:00
parent 16ffe80fd5
commit ffe1b6abd0

View File

@@ -12,9 +12,8 @@ on:
pull_request: pull_request:
jobs: jobs:
test: check:
name: "Test" name: Check
strategy: strategy:
matrix: matrix:
platform: [ platform: [
@@ -22,49 +21,67 @@ jobs:
macos-latest, macos-latest,
windows-latest windows-latest
] ]
runs-on: ${{ matrix.platform }} runs-on: ${{ matrix.platform }}
timeout-minutes: 15
steps: steps:
- name: "Checkout Repository" - uses: actions/checkout@v2
uses: actions/checkout@v1 - uses: actions-rs/toolchain@v1
with:
- name: Install Rustup profile: minimal
run: | toolchain: nightly
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly - uses: actions-rs/cargo@v1
echo ::add-path::$HOME/.cargo/bin with:
if: runner.os == 'macOS' command: check
- 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
test:
name: Test Suite
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: check_formatting:
name: "Check Formatting" name: Rustfmt
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 2
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- name: "Use the latest Rust nightly with rustfmt" - uses: actions-rs/toolchain@v1
uses: actions-rs/toolchain@v1 with:
with:
toolchain: nightly
profile: minimal profile: minimal
components: rustfmt toolchain: nightly
override: true - run: rustup component add rustfmt
- run: cargo fmt -- --check - 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
toolchain: nightly
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings