Browse Source

Merge pull request #5 from PurpleMyst/master

Add CI that runs doc, clippy, rustfmt and cross-compiles
master
Evan Cameron 2 years ago committed by GitHub
parent
commit
f34c1136e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 33
      .github/workflows/crosscompile.yml
  2. 86
      .github/workflows/linters.yml

33
.github/workflows/crosscompile.yml

@ -0,0 +1,33 @@
name: Cross-compile
on: [push, pull_request]
jobs:
test:
name: crosscompile
runs-on: ubuntu-latest
strategy:
matrix:
arch:
- thumbv6m-none-eabi
- thumbv7m-none-eabi
- thumbv7em-none-eabi
- thumbv7em-none-eabihf
steps:
- uses: actions/checkout@v2
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Install docker and start its service
run: sudo apt install -y -v docker && sudo systemctl start docker
- name: Install cross
run: cargo install cross
- name: Crosscompile
run: cross build --target ${{matrix.arch}}

86
.github/workflows/linters.yml

@ -0,0 +1,86 @@
name: Linters
on: [push, pull_request]
jobs:
build:
name: build
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: [stable, beta, nightly]
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{matrix.toolchain}}
override: true
- name: Run cargo build
run: cargo build -v
doc:
name: doc
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: [stable, beta, nightly]
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{matrix.toolchain}}
override: true
- name: Run cargo doc
run: cargo doc --no-deps
rustfmt:
name: rustfmt
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: [stable, beta, nightly]
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{matrix.toolchain}}
override: true
components: rustfmt
- name: Run rustfmt
run: cargo fmt -v -- --check
clippy:
name: clippy
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: [stable, beta, nightly]
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{matrix.toolchain}}
override: true
components: clippy
- name: Run clippy
run: cargo clippy -- -D warnings
Loading…
Cancel
Save