2019-09-11 23:28:53 +08:00
|
|
|
name: Continuous Integration
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- staging
|
|
|
|
- trying
|
|
|
|
- master
|
|
|
|
|
2020-06-16 22:54:40 +08:00
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
2019-09-11 23:28:53 +08:00
|
|
|
jobs:
|
2020-06-16 22:54:40 +08:00
|
|
|
style:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
2020-06-16 23:13:35 +08:00
|
|
|
target: thumbv7em-none-eabihf
|
2020-06-16 22:54:40 +08:00
|
|
|
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
|
2020-06-16 23:13:35 +08:00
|
|
|
continue-on-error: true
|
2020-06-16 22:54:40 +08:00
|
|
|
with:
|
2020-06-16 23:13:35 +08:00
|
|
|
command: clippy
|
2020-06-16 22:54:40 +08:00
|
|
|
|
|
|
|
compile:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
toolchain:
|
|
|
|
- stable
|
|
|
|
- beta
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-06-16 23:13:35 +08:00
|
|
|
- name: Install Rust ${{ matrix.toolchain }}
|
2020-06-16 22:54:40 +08:00
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.toolchain }}
|
2020-06-16 23:13:35 +08:00
|
|
|
target: thumbv7em-none-eabihf
|
2020-06-16 22:54:40 +08:00
|
|
|
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
|
2020-06-16 22:59:16 +08:00
|
|
|
run: exit 0
|
2020-06-16 22:54:40 +08:00
|
|
|
ci-failure:
|
|
|
|
name: ci
|
|
|
|
if: github.event_name == 'push' && !success()
|
|
|
|
needs:
|
|
|
|
- style
|
|
|
|
- compile
|
2019-09-11 23:28:53 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-06-16 22:54:40 +08:00
|
|
|
- name: Mark the job as a failure
|
|
|
|
run: exit 1
|