mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
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:
99
.github/workflows/build-code.yml
vendored
99
.github/workflows/build-code.yml
vendored
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user