Added github actions for PRs

This commit is contained in:
transistor 2024-03-16 18:58:28 -07:00
parent a2372d1355
commit 926ded02cf
8 changed files with 164 additions and 20 deletions

View File

@ -1 +1 @@
msrv = "1.60.0"
msrv = "1.70.0"

32
.github/workflows/clippy.yaml vendored Normal file
View File

@ -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

32
.github/workflows/rustdoc.yaml vendored Normal file
View File

@ -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
.github/workflows/rustfmt.yaml vendored Normal file
View File

@ -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
.github/workflows/test.yaml vendored Normal file
View File

@ -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
.rustfmt.toml Normal file
View File

@ -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
Cargo.lock generated
View File

@ -420,10 +420,6 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650"
[[package]]
name = "emulator-hal"
version = "0.1.0"
dependencies = [
"femtos",
"fugit",
]
[[package]]
name = "emulator-hal-memory"
@ -491,21 +487,6 @@ dependencies = [
"miniz_oxide",
]
[[package]]
name = "fugit"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7"
dependencies = [
"gcd",
]
[[package]]
name = "gcd"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a"
[[package]]
name = "glob"
version = "0.3.1"