-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
907c46c
commit 5c56d6d
Showing
4 changed files
with
85 additions
and
1 deletion.
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,73 @@ | ||
on: push | ||
name: CI | ||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
env: | ||
RUSTFLAGS: -D warnings | ||
CARGO_TERM_COLOR: always | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
# We need nightly for fmt | ||
toolchain: nightly | ||
override: true | ||
components: rustfmt, clippy | ||
- uses: Swatinem/rust-cache@v1 | ||
- name: Lint (clippy) | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --all-targets | ||
- name: Lint (rustfmt) | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all --check | ||
|
||
build: | ||
name: Build and test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
rust-version: [stable, 1.65, nightly] | ||
fail-fast: false | ||
env: | ||
RUSTFLAGS: -D warnings | ||
CARGO_TERM_COLOR: always | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.rust-version }} | ||
override: true | ||
components: llvm-tools-preview | ||
- uses: Swatinem/rust-cache@v1 | ||
- name: Build all targets with | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --all-targets | ||
- name: Tests | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
- name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
- name: Generate code coverage | ||
if: startsWith(matrix.rust-version, 'stable') | ||
run: cargo llvm-cov --workspace --lcov --output-path lcov.info | ||
- name: Upload coverage to Codecov | ||
if: startsWith(matrix.rust-version, 'stable') | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
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
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,5 @@ | ||
comment_width = 100 | ||
format_code_in_doc_comments = true | ||
imports_granularity = "Crate" | ||
imports_layout = "Vertical" | ||
wrap_comments = true |