91 lines
2.0 KiB
YAML
91 lines
2.0 KiB
YAML
name: Continuous Integration
|
|
on:
|
|
push:
|
|
branches:
|
|
- staging
|
|
- trying
|
|
- master
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
style:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
target: thumbv7em-none-eabihf
|
|
override: true
|
|
components: rustfmt, clippy
|
|
- name: cargo fmt --check
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: fmt
|
|
args: --all -- --check
|
|
- name: cargo clippy
|
|
uses: actions-rs/cargo@v1
|
|
continue-on-error: true
|
|
with:
|
|
command: clippy
|
|
|
|
compile:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
toolchain:
|
|
- stable
|
|
- beta
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Install Rust ${{ matrix.toolchain }}
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ matrix.toolchain }}
|
|
target: thumbv7em-none-eabihf
|
|
override: true
|
|
- name: cargo check
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: check
|
|
args: --verbose
|
|
- name: cargo build
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --verbose
|
|
- name: cargo build release
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --verbose --release
|
|
- name: cargo build release+semihosting
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --verbose --release --features semihosting
|
|
|
|
ci-success:
|
|
name: ci
|
|
if: github.event_name == 'push' && success()
|
|
needs:
|
|
- style
|
|
- compile
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Mark the job as a success
|
|
run: exit 0
|
|
ci-failure:
|
|
name: ci
|
|
if: github.event_name == 'push' && !success()
|
|
needs:
|
|
- style
|
|
- compile
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Mark the job as a failure
|
|
run: exit 1
|