pounder_test/.github/workflows/ci.yml
2021-01-20 15:02:35 +01:00

136 lines
3.5 KiB
YAML

name: Continuous Integration
on:
push:
branches: [master, staging, trying]
pull_request:
branches: [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
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --verbose
compile:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- beta
bin:
- dual-iir
- lockin
features:
- ''
- pounder_v1_1
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
components: llvm-tools-preview
- name: cargo build release
uses: actions-rs/cargo@v1
with:
command: build
args: --release --features "${{ matrix.features }}" --bin ${{ matrix.bin }}
- name: cargo-binutils
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-binutils
- name: cargo size
uses: actions-rs/cargo@v1
with:
command: size
args: --release --features "${{ matrix.features }}" --bin ${{ matrix.bin }}
- name: cargo objcopy
uses: actions-rs/cargo@v1
with:
command: objcopy
args: --release --features "${{ matrix.features }}" --bin ${{ matrix.bin }} --verbose -- -O binary ${{ matrix.bin }}-release.bin
- uses: actions/upload-artifact@v2
if: ${{ matrix.toolchain == 'stable' && matrix.features == '' }}
with:
name: stabilizer_${{ matrix.bin }}
path: |
target/*/release/${{ matrix.bin }}
${{ matrix.bin }}-release.bin
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
args: --package dsp --target=x86_64-unknown-linux-gnu
- name: cargo bench
uses: actions-rs/cargo@v1
with:
command: bench
args: --package dsp --target=x86_64-unknown-linux-gnu
# Tell bors about it
# https://github.com/rtic-rs/cortex-m-rtic/blob/8a4f9c6b8ae91bebeea0791680f89375a78bffc6/.github/workflows/build.yml#L566-L603
ci-success:
name: ci
if: github.event_name == 'push' && success()
needs:
- style
- compile
- test
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
- test
runs-on: ubuntu-latest
steps:
- name: Mark the job as a failure
run: exit 1