Skip to content

Commit

Permalink
Add basic CI script
Browse files Browse the repository at this point in the history
  • Loading branch information
schteve committed Oct 28, 2022
1 parent a539289 commit b00fc55
Showing 1 changed file with 89 additions and 0 deletions.
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 }}

0 comments on commit b00fc55

Please sign in to comment.