-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub actions for Rust code (#2)
- Loading branch information
Showing
6 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Coverage | ||
|
||
on: [pull_request, push] | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
env: | ||
CARGO_TERM_COLOR: always | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Rust toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
components: llvm-tools-preview | ||
- name: Install cargo-nextest | ||
uses: taiki-e/install-action@cargo-nextest | ||
- name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
- name: Generate code coverage | ||
working_dir: Code | ||
run: cargo llvm-cov nextest --all-features --workspace --lcov --output-path lcov.info | ||
- name: Generate text report | ||
working_dir: Code | ||
run: cargo llvm-cov report --text | ||
# - name: Upload coverage to Codecov | ||
# uses: codecov/codecov-action@v3 | ||
# working_dir: Code | ||
# with: | ||
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | ||
# files: lcov.info | ||
# fail_ci_if_error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: "Rust" | ||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Rust toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
- name: Install cargo-nextest | ||
uses: taiki-e/install-action@cargo-hack | ||
- name: Build code | ||
working_dir: Code | ||
run: cargo nextest run --workspace --all-features --no-run | ||
- name: Run tests | ||
working_dir: Code | ||
run: cargo nextest run --workspace --all-features | ||
|
||
clippy: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Rust toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
components: clippy | ||
- uses: auguwu/clippy-action@1 | ||
with: | ||
token: ${{secrets.GITHUB_TOKEN}} | ||
|
||
fmt: | ||
name: Formatting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Rust toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
components: rustfmt | ||
- name: Check formatting | ||
uses: actions-rust-lang/rustfmt@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[workspace] | ||
resolver = "2" | ||
|
||
members = [ | ||
"round-sm" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[toolchain] | ||
channel = "stable" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
max_width = 120 | ||
comment_width = 100 |