From b2f17d26db9ecae44185c1e000b0113aba6c9526 Mon Sep 17 00:00:00 2001 From: Keisuke Umeno <9renpoto@gmail.com> Date: Sat, 17 Jun 2023 16:06:34 +0900 Subject: [PATCH 01/11] :thinking: --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7d293c3..a8c08fc 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,7 +19,7 @@ jobs: toolchain: stable override: true - name: Run cargo-tarpaulin - uses: actions-rs/tarpaulin@v0.1 + uses: actions-rs/tarpaulin@v0.1.0 with: out-type: Lcov - name: Coveralls upload From 64217d4fa1e1b38a034d6d1fb1de904cdea5bb51 Mon Sep 17 00:00:00 2001 From: Keisuke Umeno <9renpoto@gmail.com> Date: Sat, 17 Jun 2023 16:10:31 +0900 Subject: [PATCH 02/11] :thinking: --- .github/workflows/rust.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a8c08fc..8e30dbe 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -22,6 +22,8 @@ jobs: uses: actions-rs/tarpaulin@v0.1.0 with: out-type: Lcov + version: '0.15.0' + args: '-- --test-threads 1' - name: Coveralls upload uses: coverallsapp/github-action@1.1.3 with: From 089e9e823357b029a13fb29e9471c38ca5f8a953 Mon Sep 17 00:00:00 2001 From: Keisuke Umeno <9renpoto@gmail.com> Date: Sun, 18 Jun 2023 10:22:09 +0900 Subject: [PATCH 03/11] feat: replace actions-rs --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8e30dbe..bdb69f1 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - name: rustup toolchain install + uses: dtolnay/rust-toolchain@v1 with: toolchain: stable - override: true - name: Run cargo-tarpaulin uses: actions-rs/tarpaulin@v0.1.0 with: From 6dd9c77f661fa2f18f86015cb1bfaa168362c4e7 Mon Sep 17 00:00:00 2001 From: Keisuke Umeno <9renpoto@gmail.com> Date: Sun, 18 Jun 2023 10:33:25 +0900 Subject: [PATCH 04/11] chore: use dtolnay rust-toolchain --- .github/workflows/rust.yml | 44 ++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index bdb69f1..3ff5129 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -11,33 +11,41 @@ env: jobs: test: + needs: check runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: rustup toolchain install - uses: dtolnay/rust-toolchain@v1 + - uses: dtolnay/rust-toolchain@v1 with: toolchain: stable - - name: Run cargo-tarpaulin - uses: actions-rs/tarpaulin@v0.1.0 - with: - out-type: Lcov - version: '0.15.0' - args: '-- --test-threads 1' - - name: Coveralls upload - uses: coverallsapp/github-action@1.1.3 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: lcov.info - clippy_check: + # - name: Run cargo-tarpaulin + # uses: actions-rs/tarpaulin@v0.1.0 + # with: + # out-type: Lcov + # version: '0.15.0' + # args: '-- --test-threads 1' + - uses: Swatinem/rust-cache@v2 + - name: Run tests + run: cargo test --workspace --all-features --all-targets + # - name: Coveralls upload + # uses: coverallsapp/github-action@1.1.3 + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # path-to-lcov: lcov.info + 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 From 6d308b966941cfa69eb572872e0dd6b677d663fd Mon Sep 17 00:00:00 2001 From: Keisuke Umeno <9renpoto@gmail.com> Date: Sun, 18 Jun 2023 10:40:47 +0900 Subject: [PATCH 05/11] chore: fmt --- src/main.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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); + } } From 1d2aa14975ed4056f6dc8f24c07949949bf68418 Mon Sep 17 00:00:00 2001 From: Keisuke Umeno <9renpoto@gmail.com> Date: Sun, 18 Jun 2023 11:07:30 +0900 Subject: [PATCH 06/11] chore: collect coverage --- .github/workflows/rust.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 3ff5129..0d32423 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -26,12 +26,15 @@ jobs: # args: '-- --test-threads 1' - uses: Swatinem/rust-cache@v2 - name: Run tests - run: cargo test --workspace --all-features --all-targets - # - name: Coveralls upload - # uses: coverallsapp/github-action@1.1.3 - # with: - # github-token: ${{ secrets.GITHUB_TOKEN }} - # path-to-lcov: lcov.info + run: | + - cargo test --workspace --all-features --all-targets + - cargo install grcov + - grcov . --binary-path ./target/debug/ -s . -t cobertura --branch --ignore-not-existing --ignore "*cargo*" -o coverage.xml + - name: Coveralls upload + uses: coverallsapp/github-action@1.1.3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + format: cobertura check: runs-on: ubuntu-latest steps: From fbf2049f6cd31142bda4d37babda4749bfa23c3c Mon Sep 17 00:00:00 2001 From: Keisuke Umeno <9renpoto@gmail.com> Date: Sun, 18 Jun 2023 11:17:09 +0900 Subject: [PATCH 07/11] chore: thinking about --- .github/workflows/rust.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0d32423..cb4ea6f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -18,23 +18,16 @@ jobs: - uses: dtolnay/rust-toolchain@v1 with: toolchain: stable - # - name: Run cargo-tarpaulin - # uses: actions-rs/tarpaulin@v0.1.0 - # with: - # out-type: Lcov - # version: '0.15.0' - # args: '-- --test-threads 1' - uses: Swatinem/rust-cache@v2 - name: Run tests run: | - cargo test --workspace --all-features --all-targets - cargo install grcov - - grcov . --binary-path ./target/debug/ -s . -t cobertura --branch --ignore-not-existing --ignore "*cargo*" -o coverage.xml + - grcov . --binary-path ./target/debug/ -t coveralls -s . > coveralls.json - name: Coveralls upload uses: coverallsapp/github-action@1.1.3 with: github-token: ${{ secrets.GITHUB_TOKEN }} - format: cobertura check: runs-on: ubuntu-latest steps: From 8843e4da9d38e5c18e90bd5a2d7044c018738b15 Mon Sep 17 00:00:00 2001 From: Keisuke Umeno <9renpoto@gmail.com> Date: Sun, 18 Jun 2023 11:22:55 +0900 Subject: [PATCH 08/11] chore: thinking about --- .github/workflows/rust.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index cb4ea6f..d8f9e12 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -18,12 +18,11 @@ jobs: - uses: dtolnay/rust-toolchain@v1 with: toolchain: stable + components: llvm-tools-preview - uses: Swatinem/rust-cache@v2 - - name: Run tests - run: | - - cargo test --workspace --all-features --all-targets - - cargo install grcov - - grcov . --binary-path ./target/debug/ -t coveralls -s . > coveralls.json + - run: cargo test --workspace --all-features --all-targets + - run: cargo install grcov + - run: grcov . --binary-path ./target/debug/ -t coveralls -s . > coveralls.json - name: Coveralls upload uses: coverallsapp/github-action@1.1.3 with: From 2c1e33057dd2518a7c7a4a19ec68618d4b8cdd45 Mon Sep 17 00:00:00 2001 From: Keisuke Umeno <9renpoto@gmail.com> Date: Sun, 18 Jun 2023 11:31:20 +0900 Subject: [PATCH 09/11] chore: thinking about --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d8f9e12..1abf3ae 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -22,7 +22,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - run: cargo test --workspace --all-features --all-targets - run: cargo install grcov - - run: grcov . --binary-path ./target/debug/ -t coveralls -s . > coveralls.json + - run: grcov . --binary-path ./target/debug/ - name: Coveralls upload uses: coverallsapp/github-action@1.1.3 with: From c8ef7b8ac044894762d8bd9c02ab29e0ca54bff5 Mon Sep 17 00:00:00 2001 From: Keisuke Umeno <9renpoto@gmail.com> Date: Sun, 18 Jun 2023 11:37:17 +0900 Subject: [PATCH 10/11] chore: thinking about --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1abf3ae..99a005b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -22,7 +22,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - run: cargo test --workspace --all-features --all-targets - run: cargo install grcov - - run: grcov . --binary-path ./target/debug/ + - run: grcov . --binary-path ./target/debug/ -s . --keep-only 'src/*' - name: Coveralls upload uses: coverallsapp/github-action@1.1.3 with: From bec9e3fa310b9b42abbe6e8dce41ad1f829a174c Mon Sep 17 00:00:00 2001 From: Keisuke Umeno <9renpoto@gmail.com> Date: Sun, 18 Jun 2023 12:02:46 +0900 Subject: [PATCH 11/11] fix: skip collect coverage --- .github/workflows/rust.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 99a005b..ed0c175 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -21,12 +21,12 @@ jobs: 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 }} + # - 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: