Skip to content

Commit

Permalink
Added github actions for PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
transistorfet committed Mar 17, 2024
1 parent a2372d1 commit 926ded0
Show file tree
Hide file tree
Showing 8 changed files with 164 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.60.0"
msrv = "1.70.0"
32 changes: 32 additions & 0 deletions .github/workflows/clippy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: clippy
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read

jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install dependencies
run: |
sudo apt-get install -y alsa-base libasound2-dev libxkbcommon-dev
- name: Select rust version
run: |
rustup toolchain install 1.70 --profile minimal --no-self-update
rustup default 1.70
rustup component add clippy
- name: Check clippy
run: |
cargo clippy
File renamed without changes.
32 changes: 32 additions & 0 deletions .github/workflows/rustdoc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: rustdoc
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read

jobs:
rustdocs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install dependencies
run: |
sudo apt-get install -y alsa-base libasound2-dev libxkbcommon-dev
- name: Select rust version
run: |
rm Cargo.lock
rustup toolchain install nightly --profile minimal --no-self-update
rustup default nightly
- name: Build rustdoc
run: |
RUSTDOCFLAGS="--deny=warnings --cfg=docsrs" cargo doc --all-features
31 changes: 31 additions & 0 deletions .github/workflows/rustfmt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: rustfmt
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read

jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install dependencies
run: |
sudo apt-get install -y alsa-base libasound2-dev libxkbcommon-dev
- name: Select rust version
run: |
rustup toolchain install 1.70 --profile minimal --no-self-update
rustup default 1.70
- name: Check rustfmt
run: |
cargo fmt --check
44 changes: 44 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: test
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read

env:
RUSTFLAGS: '--deny warnings'

jobs:
test-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install dependencies
run: |
sudo apt-get install -y alsa-base libasound2-dev libxkbcommon-dev
- name: Select rust version
run: |
rustup toolchain install 1.70 --profile minimal --no-self-update
rustup default 1.70
- name: Run tests with default features
run: |
cargo test
- name: Run tests with all features
run: |
cargo test #--features=std,fugit,femtos
- name: Run test with no_std
run: |
cargo test --no-default-features
24 changes: 24 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
edition = "2021"

max_width = 132

struct_lit_width = 0 # default 18 (24)
fn_call_width=132 # default 60 (80)
attr_fn_like_width=100 # default 70 (92)
array_width=132 # default 60 (80)
#chain_width=100 # default 60 (80)
#single_line_if_else_max_width=100 # default 50 (66)
#struct_variant_width = 0 # default 35 (46)

newline_style = "Unix"
reorder_imports = false
match_block_trailing_comma = true

## Experimental Features
unstable_features = true
blank_lines_upper_bound = 3
overflow_delimited_expr = true

# need a newline at the top and bottom of file
# need to be able to align const equals
# need to not erase whitespace between end of line and comment
19 changes: 0 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 926ded0

Please sign in to comment.