name: CI
on:
push:
branches: [ main, staging, trying ]
pull_request:
branches: [ main ]
schedule:
- cron: '1 0 * * *'
env:
CARGO_TERM_COLOR: always
APP_NAME: test-flip-link-app
CORE_TARGET: thumbv7m-none-eabi
jobs:
test:
strategy:
matrix:
rust:
- stable
- nightly
os:
- ubuntu-latest
- macOS-latest
- windows-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Build
run: RUSTFLAGS='--deny warnings' cargo build
shell: bash
static-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy, rustfmt
- run: cargo fmt --all -- --check
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
build_app:
strategy:
matrix:
rust:
- stable
- nightly
os:
- ubuntu-latest
- macOS-latest
- windows-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- name: Check out flip-link repo
uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
target: ${{ env.CORE_TARGET }}
- name: Install dependencies
run: |
cargo install --debug --path .
- name: Build App
run: |
cd ${{ env.APP_NAME }}
cargo build --examples
ci-success:
name: ci
if: success()
needs:
- build_app
- static-checks
- test
runs-on: ubuntu-latest
steps:
- name: CI succeeded
run: exit 0