Skip to content

Commit

Permalink
Merge pull request #2 from pbert519/ci
Browse files Browse the repository at this point in the history
Introduce CI
  • Loading branch information
pbert519 authored Jan 29, 2024
2 parents 6807221 + 6bfbe42 commit da27c80
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 4 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Rust

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- thumbv7em-none-eabi
rust:
- stable
- nightly
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --target=${{ matrix.target }}

test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test

lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ impl<IT8951Interface: interface::IT8951Interface> IT8951<IT8951Interface, Off> {
interface,
dev_info: None,
marker: PhantomData {},
}.sys_run()?;

}
.sys_run()?;

it8951.dev_info = Some(it8951.get_system_info()?);

Ok(it8951)
}

}

impl<IT8951Interface: interface::IT8951Interface> IT8951<IT8951Interface, Run> {
Expand Down
4 changes: 3 additions & 1 deletion src/pixel_serializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ impl<I: Iterator<Item = Pixel<Gray4>>> PixelSerializer<I> {
area,
pixels,
row: 0,
/// 512 * 2 Bytes = 1kByte
// 512 * 2 Bytes = 1kByte
max_entries: 512,
}
}
// max buffer size in 16bit words
// TODO make variable buffer size available via public api
#[allow(unused)]
pub fn with_buffer_max_words(self, size: usize) -> Self {
Self {
max_entries: size,
Expand Down

0 comments on commit da27c80

Please sign in to comment.