From f0455b4b4c1a173e45efcb905f13b91038e2dce0 Mon Sep 17 00:00:00 2001 From: Keisuke Umeno <9renpoto@gmail.com> Date: Sun, 18 Jun 2023 12:04:02 +0900 Subject: [PATCH] chore: skip coverage (#95) * :thinking: * :thinking: * feat: replace actions-rs * chore: use dtolnay rust-toolchain * chore: fmt * chore: collect coverage * chore: thinking about * chore: thinking about * chore: thinking about * chore: thinking about * fix: skip collect coverage --- .github/workflows/rust.yml | 37 +++++++++++++++++++++---------------- src/main.rs | 18 +++++++++--------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7d293c3..ed0c175 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -11,31 +11,36 @@ env: jobs: test: + needs: check runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@v1 with: toolchain: stable - override: true - - name: Run cargo-tarpaulin - uses: actions-rs/tarpaulin@v0.1 - with: - out-type: Lcov - - name: Coveralls upload - uses: coverallsapp/github-action@1.1.3 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: lcov.info - clippy_check: + components: llvm-tools-preview + - uses: Swatinem/rust-cache@v2 + - run: cargo test --workspace --all-features --all-targets + # - run: cargo install grcov + # - run: grcov . --binary-path ./target/debug/ -s . --keep-only 'src/*' + # - name: Coveralls upload + # uses: coverallsapp/github-action@1.1.3 + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@v1 with: toolchain: stable components: rustfmt, clippy - - uses: actions-rs/clippy-check@v1.0.7 + - name: rustup toolchain install + uses: dtolnay/rust-toolchain@v1 with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features + toolchain: stable + - uses: Swatinem/rust-cache@v2 + - name: Check + run: cargo clippy --workspace --all-targets --all-features -- -D warnings + - name: rustfmt + run: cargo fmt --all --check diff --git a/src/main.rs b/src/main.rs index 8b86641..b12b411 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,18 +3,18 @@ fn main() { } pub fn prints_and_returns_10(a: i32) -> i32 { - //{}という値を得た - println!("I got the value {}", a); - 10 + //{}という値を得た + println!("I got the value {}", a); + 10 } #[cfg(test)] mod tests { - use super::*; + use super::*; - #[test] - fn this_test_will_pass() { - let value = prints_and_returns_10(4); - assert_eq!(10, value); - } + #[test] + fn this_test_will_pass() { + let value = prints_and_returns_10(4); + assert_eq!(10, value); + } }