2020-06-15 14:09:31 +00:00
|
|
|
name: Rust
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-07-16 13:17:48 +00:00
|
|
|
branches: [ main ]
|
2020-06-15 14:09:31 +00:00
|
|
|
pull_request:
|
2020-07-16 13:17:48 +00:00
|
|
|
branches: [ main ]
|
2020-06-15 14:09:31 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: check out repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: set up rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
|
|
|
|
- name: set up actions.rs
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
|
|
|
|
- name: cache rust dependencies
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/registry
|
|
|
|
~/.cargo/git
|
|
|
|
target
|
|
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
|
|
|
|
- name: cache linux dependencies
|
|
|
|
uses: actions/cache@v2
|
|
|
|
if: startsWith(runner.os, 'Linux')
|
|
|
|
with:
|
|
|
|
path: ~/.local/share/renv
|
|
|
|
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-renv-
|
|
|
|
|
|
|
|
- name: install all dependencies
|
|
|
|
run: |
|
2021-01-20 14:37:23 +00:00
|
|
|
sudo apt update
|
2020-06-15 14:09:31 +00:00
|
|
|
sudo apt-get install libudev-dev libusb-1.0-0-dev
|
2020-08-24 10:04:11 +00:00
|
|
|
rustup +stable target add thumbv7em-none-eabihf
|
2020-06-15 14:09:31 +00:00
|
|
|
|
2021-01-26 10:18:39 +00:00
|
|
|
- name: build xtask'ed tools
|
|
|
|
working-directory: ./xtask
|
2020-07-09 08:15:07 +00:00
|
|
|
run: |
|
|
|
|
cargo build --verbose
|
|
|
|
cargo fmt --all -- --check
|
2020-06-15 14:09:31 +00:00
|
|
|
|
2021-01-26 10:18:39 +00:00
|
|
|
# todo try xtask basics
|
|
|
|
|
|
|
|
|
2020-07-09 08:15:07 +00:00
|
|
|
- name: build and fmt beginner/apps
|
2020-06-15 14:09:31 +00:00
|
|
|
working-directory: ./beginner/apps
|
2020-07-09 08:15:07 +00:00
|
|
|
run: |
|
|
|
|
cargo build --verbose
|
|
|
|
cargo fmt --all -- --check
|
2020-06-15 14:09:31 +00:00
|
|
|
|
2020-07-09 08:15:07 +00:00
|
|
|
- name: build and fmt advanced/firmware
|
2020-06-17 09:16:40 +00:00
|
|
|
working-directory: ./advanced/firmware
|
2020-07-09 08:15:07 +00:00
|
|
|
run: |
|
|
|
|
cargo build --verbose
|
2020-07-16 13:17:48 +00:00
|
|
|
cargo fmt --all -- --check
|