Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI script #42

Merged
merged 1 commit into from Nov 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,89 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
CARGO_TERM_COLOR: always

jobs:
freertos-rust:
name: Build freertos-rust
runs-on: ubuntu-latest
#env:
# RUSTFLAGS: -D warnings # Warnings disabled only in CI
steps:
- name: Clone
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.rustup
target
key: ${{ runner.os }}-${{ runner.arch }}
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
#- name: Format
# run: cargo fmt -- --check
- name: Build
run: cargo build --verbose
#- name: Test
# run: cargo test
#- name: Clippy
# run: cargo clippy -- -Dwarnings
freertos-rust-examples:
name: Build examples
runs-on: ubuntu-latest
strategy:
matrix:
include:
#- example: win
# target: x86_64-pc-windows-gnu
#- example: linux
# target: x86_64-unknown-linux-gnu
#- example: stm32-cortex-m3
# target: thumbv7m-none-eabi
- example: stm32-cortex-m4-blackpill
target: thumbv7em-none-eabihf
#- example: nrf9160
# target: thumbv8m.main-none-eabihf
#env:
# RUSTFLAGS: -D warnings # Warnings disabled only in CI
steps:
- name: Clone
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.rustup
target
key: ${{ runner.os }}-${{ runner.arch }}
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
targets: ${{ matrix.target }}
- name: Install cross deps
run: |
case ${{ matrix.target }} in
"x86_64-pc-windows-gnu")
sudo apt-get install -y gcc-mingw-w64
;;
"thumbv7m-none-eabi" | "thumbv7em-none-eabihf" | "thumbv8m.main-none-eabihf")
sudo apt-get install -y gcc-arm-none-eabi
;;
esac
- name: Build example
run: cargo build --verbose --example ${{ matrix.example }} --target ${{ matrix.target }}