2020-06-16 23:32:28 +08:00
|
|
|
name: Continuous Integration
|
|
|
|
|
2019-09-11 23:28:53 +08:00
|
|
|
on:
|
|
|
|
push:
|
2020-11-05 15:13:55 +08:00
|
|
|
branches: [master, staging, trying]
|
|
|
|
pull_request:
|
|
|
|
branches: [master]
|
2019-09-11 23:28:53 +08:00
|
|
|
|
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
|
2021-01-09 02:09:42 +08:00
|
|
|
toolchain: stable
|
2020-12-11 22:19:13 +08:00
|
|
|
target: thumbv7em-none-eabihf
|
2020-06-16 22:54:40 +08:00
|
|
|
override: true
|
2020-12-12 00:04:34 +08:00
|
|
|
components: rustfmt, clippy
|
2020-06-16 22:54:40 +08:00
|
|
|
- name: cargo fmt --check
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: --all -- --check
|
2020-11-26 21:48:02 +08:00
|
|
|
- uses: actions-rs/clippy-check@v1
|
2020-06-16 22:54:40 +08:00
|
|
|
with:
|
2020-11-26 21:48:02 +08:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2021-01-20 22:02:35 +08:00
|
|
|
- name: cargo check
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: check
|
|
|
|
args: --verbose
|
2020-06-16 22:54:40 +08:00
|
|
|
|
|
|
|
compile:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
toolchain:
|
|
|
|
- stable
|
2021-01-20 22:02:35 +08:00
|
|
|
bin:
|
|
|
|
- dual-iir
|
2021-02-01 02:31:09 +08:00
|
|
|
- lockin-internal
|
|
|
|
- lockin-external
|
2021-01-20 22:02:35 +08:00
|
|
|
features:
|
|
|
|
- ''
|
2021-02-01 02:31:09 +08:00
|
|
|
include:
|
|
|
|
- toolchain: beta
|
|
|
|
bin: dual-iir
|
|
|
|
features: ''
|
|
|
|
- toolchain: stable
|
|
|
|
bin: lockin-internal
|
|
|
|
features: pounder_v1_1
|
2020-06-16 22:54:40 +08:00
|
|
|
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
|
2020-12-12 00:36:10 +08:00
|
|
|
components: llvm-tools-preview
|
2020-06-16 22:54:40 +08:00
|
|
|
- name: cargo build release
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: build
|
2021-01-20 22:02:35 +08:00
|
|
|
args: --release --features "${{ matrix.features }}" --bin ${{ matrix.bin }}
|
2020-12-12 00:36:10 +08:00
|
|
|
- name: cargo-binutils
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: install
|
|
|
|
args: cargo-binutils
|
2020-12-12 01:07:15 +08:00
|
|
|
- name: cargo size
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: size
|
2021-01-20 22:02:35 +08:00
|
|
|
args: --release --features "${{ matrix.features }}" --bin ${{ matrix.bin }}
|
2020-12-12 00:36:10 +08:00
|
|
|
- name: cargo objcopy
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: objcopy
|
2021-01-20 22:02:35 +08:00
|
|
|
args: --release --features "${{ matrix.features }}" --bin ${{ matrix.bin }} --verbose -- -O binary ${{ matrix.bin }}-release.bin
|
2020-12-12 01:22:16 +08:00
|
|
|
- uses: actions/upload-artifact@v2
|
2021-01-20 22:02:35 +08:00
|
|
|
if: ${{ matrix.toolchain == 'stable' && matrix.features == '' }}
|
2020-12-12 00:36:10 +08:00
|
|
|
with:
|
2021-01-20 22:02:35 +08:00
|
|
|
name: stabilizer_${{ matrix.bin }}
|
2020-12-12 00:36:10 +08:00
|
|
|
path: |
|
2021-01-20 22:02:35 +08:00
|
|
|
target/*/release/${{ matrix.bin }}
|
|
|
|
${{ matrix.bin }}-release.bin
|
2021-01-06 21:59:01 +08:00
|
|
|
|
2020-11-19 06:55:55 +08:00
|
|
|
test:
|
|
|
|
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 }}
|
|
|
|
- name: cargo test
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
2020-12-05 00:13:02 +08:00
|
|
|
args: --package dsp --target=x86_64-unknown-linux-gnu
|
2020-12-11 22:19:13 +08:00
|
|
|
- name: cargo bench
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: bench
|
|
|
|
args: --package dsp --target=x86_64-unknown-linux-gnu
|
2020-11-19 06:55:55 +08:00
|
|
|
|
2020-06-16 23:42:38 +08:00
|
|
|
# Tell bors about it
|
|
|
|
# https://github.com/rtic-rs/cortex-m-rtic/blob/8a4f9c6b8ae91bebeea0791680f89375a78bffc6/.github/workflows/build.yml#L566-L603
|
2020-06-16 22:54:40 +08:00
|
|
|
ci-success:
|
|
|
|
name: ci
|
|
|
|
if: github.event_name == 'push' && success()
|
|
|
|
needs:
|
|
|
|
- style
|
|
|
|
- compile
|
2020-12-12 00:06:07 +08:00
|
|
|
- test
|
2020-06-16 22:54:40 +08:00
|
|
|
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
|
2020-12-12 00:06:07 +08:00
|
|
|
- test
|
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
|