From 4a1c625bee0d7d80de987f45d85355bbd3f857df Mon Sep 17 00:00:00 2001 From: get-me-power Date: Fri, 3 Feb 2023 04:08:16 +0900 Subject: [PATCH 01/11] chore: add macos, linux in ci --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a502e80..71d7510a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,10 @@ on: jobs: build: - runs-on: windows-latest + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@main - name: Setup .NET From 870651137299b9a5f0700c9409702de949b6f6ac Mon Sep 17 00:00:00 2001 From: get-me-power Date: Sat, 4 Feb 2023 21:13:03 +0900 Subject: [PATCH 02/11] chore: delete net462 --- src/nunit.analyzers.tests/nunit.analyzers.tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nunit.analyzers.tests/nunit.analyzers.tests.csproj b/src/nunit.analyzers.tests/nunit.analyzers.tests.csproj index c9343736..c86ac8bd 100644 --- a/src/nunit.analyzers.tests/nunit.analyzers.tests.csproj +++ b/src/nunit.analyzers.tests/nunit.analyzers.tests.csproj @@ -1,7 +1,7 @@ NUnit.Analyzers.Tests - net6.0;net462 + net6.0 From 552b72c686da6de7b06c53efe9f757c615c0432a Mon Sep 17 00:00:00 2001 From: get-me-power Date: Sun, 5 Feb 2023 19:32:42 +0900 Subject: [PATCH 03/11] chore: Specify per-os tests on ci --- .github/workflows/ci.yml | 9 +++++++-- src/nunit.analyzers.tests/nunit.analyzers.tests.csproj | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71d7510a..9197156c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,5 +18,10 @@ jobs: uses: actions/setup-dotnet@main with: global-json-file: ./global.json - - name: dotnet test - run: dotnet test ./src/nunit.analyzers.tests/ + - name: Run Test + run: | + if [ "$RUNNER_OS" == "Windows"]: then + dotnet test ./src/nunit.analyzers.tests/ + else + dotnet test -f net6.0 ./src/nunit.analyzers.tests/ + fi diff --git a/src/nunit.analyzers.tests/nunit.analyzers.tests.csproj b/src/nunit.analyzers.tests/nunit.analyzers.tests.csproj index c86ac8bd..c9343736 100644 --- a/src/nunit.analyzers.tests/nunit.analyzers.tests.csproj +++ b/src/nunit.analyzers.tests/nunit.analyzers.tests.csproj @@ -1,7 +1,7 @@ NUnit.Analyzers.Tests - net6.0 + net6.0;net462 From 283e5b24fab0fbbe5101c874dd856252f0582ea1 Mon Sep 17 00:00:00 2001 From: get-me-power Date: Sun, 5 Feb 2023 19:35:04 +0900 Subject: [PATCH 04/11] chore: fix syntax error --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9197156c..e58f3396 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,8 +20,9 @@ jobs: global-json-file: ./global.json - name: Run Test run: | - if [ "$RUNNER_OS" == "Windows"]: then + if [ "$RUNNER_OS" == "Windows"]; then dotnet test ./src/nunit.analyzers.tests/ else dotnet test -f net6.0 ./src/nunit.analyzers.tests/ fi + shell: bash From 7b8b0e344d2eef6c65b5143a92ca37b968edc837 Mon Sep 17 00:00:00 2001 From: get-me-power Date: Sun, 5 Feb 2023 21:05:29 +0900 Subject: [PATCH 05/11] chore: update ci --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e58f3396..6758784b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,11 +18,11 @@ jobs: uses: actions/setup-dotnet@main with: global-json-file: ./global.json - - name: Run Test + - name: .NET6.0 Test run: | - if [ "$RUNNER_OS" == "Windows"]; then - dotnet test ./src/nunit.analyzers.tests/ - else dotnet test -f net6.0 ./src/nunit.analyzers.tests/ - fi - shell: bash + + - name: .NET Framework Test + if: runner.os == 'Windows' + run: | + dotnet test -f net462 ./src/nunit.analyzers.test From aafb641801a9d3f09a5b58ff709310118c1b178e Mon Sep 17 00:00:00 2001 From: get-me-power Date: Sun, 5 Feb 2023 21:12:36 +0900 Subject: [PATCH 06/11] fix: typo --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6758784b..83da39cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,4 +25,4 @@ jobs: - name: .NET Framework Test if: runner.os == 'Windows' run: | - dotnet test -f net462 ./src/nunit.analyzers.test + dotnet test -f net462 ./src/nunit.analyzers.tests/ From 4a4e69225e7a86f61cf9f623dd7eff771fd0cf62 Mon Sep 17 00:00:00 2001 From: get-me-power Date: Tue, 7 Feb 2023 02:08:29 +0900 Subject: [PATCH 07/11] chore: add octocov to get code coverage --- .github/workflows/ci.yml | 8 +++++++- src/.config/dotnet-tools.json | 12 ++++++++++++ src/.octocov.yml | 21 +++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 src/.config/dotnet-tools.json create mode 100644 src/.octocov.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83da39cb..383f7a29 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,4 +25,10 @@ jobs: - name: .NET Framework Test if: runner.os == 'Windows' run: | - dotnet test -f net462 ./src/nunit.analyzers.tests/ + dotnet tool restore + dotnet test --collect:"" -f net462 ./src/nunit.analyzers.tests/ + dotnet dotnet-coverage merge -o merged.cobertura.xml -f cobertura -r coverage.cobertura.xml + + - name: Post Coverage + uses: k1LoW/octocov-action@v0 + if: runner.os == 'Windows' diff --git a/src/.config/dotnet-tools.json b/src/.config/dotnet-tools.json new file mode 100644 index 00000000..a5fa4225 --- /dev/null +++ b/src/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-coverage": { + "version": "17.6.4", + "commands": [ + "dotnet-coverage" + ] + } + } +} \ No newline at end of file diff --git a/src/.octocov.yml b/src/.octocov.yml new file mode 100644 index 00000000..5fb4c563 --- /dev/null +++ b/src/.octocov.yml @@ -0,0 +1,21 @@ +coverage: + paths: + - merged.covertura.xml + +codeToTestRatio: + code: # files to count as "Code" + - 'src/nunit.analyzers/**/*.cs' + test: # files to count as "Test" + - 'src/nunit.analyzers.tests/**/*.cs' + +comment: + if: is_pull_request + +report: + if: is_default_branch + datastores: + - artifact://${GITHUB_REPOSITORY} + +diff: + datastores: + - artifact://${GITHUB_REPOSITORY} From 3d6e3f4b0654318ed30d250cbf2fc21442498b51 Mon Sep 17 00:00:00 2001 From: get-me-power Date: Tue, 7 Feb 2023 02:10:44 +0900 Subject: [PATCH 08/11] chore: fix ci config --- .github/workflows/ci.yml | 2 +- src/.octocov.yml => .octocov.yml | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/.octocov.yml => .octocov.yml (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 383f7a29..8012d578 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: if: runner.os == 'Windows' run: | dotnet tool restore - dotnet test --collect:"" -f net462 ./src/nunit.analyzers.tests/ + dotnet test --collect:"XPlat Code Coverage" -f net462 ./src/nunit.analyzers.tests/ dotnet dotnet-coverage merge -o merged.cobertura.xml -f cobertura -r coverage.cobertura.xml - name: Post Coverage diff --git a/src/.octocov.yml b/.octocov.yml similarity index 100% rename from src/.octocov.yml rename to .octocov.yml From 41ae50e222bc43ad9311e17e72e33b7c9671dc79 Mon Sep 17 00:00:00 2001 From: get-me-power Date: Tue, 7 Feb 2023 02:23:40 +0900 Subject: [PATCH 09/11] chore: global install --- .github/workflows/ci.yml | 4 ++-- src/.config/dotnet-tools.json | 12 ------------ 2 files changed, 2 insertions(+), 14 deletions(-) delete mode 100644 src/.config/dotnet-tools.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8012d578..dee51981 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,9 +25,9 @@ jobs: - name: .NET Framework Test if: runner.os == 'Windows' run: | - dotnet tool restore + dotnet tool install --global dotnet-coverage dotnet test --collect:"XPlat Code Coverage" -f net462 ./src/nunit.analyzers.tests/ - dotnet dotnet-coverage merge -o merged.cobertura.xml -f cobertura -r coverage.cobertura.xml + dotnet-coverage merge -o merged.cobertura.xml -f cobertura -r coverage.cobertura.xml - name: Post Coverage uses: k1LoW/octocov-action@v0 diff --git a/src/.config/dotnet-tools.json b/src/.config/dotnet-tools.json deleted file mode 100644 index a5fa4225..00000000 --- a/src/.config/dotnet-tools.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": 1, - "isRoot": true, - "tools": { - "dotnet-coverage": { - "version": "17.6.4", - "commands": [ - "dotnet-coverage" - ] - } - } -} \ No newline at end of file From 8b5843615425ff4485328ad263b13b1c65635e3d Mon Sep 17 00:00:00 2001 From: get-me-power Date: Tue, 7 Feb 2023 02:36:37 +0900 Subject: [PATCH 10/11] chore: add codecoverage's lib --- src/nunit.analyzers.tests/nunit.analyzers.tests.csproj | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/nunit.analyzers.tests/nunit.analyzers.tests.csproj b/src/nunit.analyzers.tests/nunit.analyzers.tests.csproj index c9343736..418ae826 100644 --- a/src/nunit.analyzers.tests/nunit.analyzers.tests.csproj +++ b/src/nunit.analyzers.tests/nunit.analyzers.tests.csproj @@ -5,6 +5,10 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + @@ -17,8 +21,7 @@ - + From c7f1005ac2973e5dd6834e6dded5fcf88d96505f Mon Sep 17 00:00:00 2001 From: get-me-power Date: Tue, 7 Feb 2023 02:49:21 +0900 Subject: [PATCH 11/11] chore: octocov support for only linux --- .github/workflows/ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dee51981..d716b92f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,17 +18,18 @@ jobs: uses: actions/setup-dotnet@main with: global-json-file: ./global.json + - name: .NET6.0 Test run: | - dotnet test -f net6.0 ./src/nunit.analyzers.tests/ + dotnet tool install --global dotnet-coverage + dotnet test --collect:"XPlat Code Coverage" -f net6.0 ./src/nunit.analyzers.tests/ + dotnet-coverage merge -o merged.cobertura.xml -f cobertura -r coverage.cobertura.xml - name: .NET Framework Test if: runner.os == 'Windows' run: | - dotnet tool install --global dotnet-coverage - dotnet test --collect:"XPlat Code Coverage" -f net462 ./src/nunit.analyzers.tests/ - dotnet-coverage merge -o merged.cobertura.xml -f cobertura -r coverage.cobertura.xml + dotnet test -f net462 ./src/nunit.analyzers.tests/ - name: Post Coverage uses: k1LoW/octocov-action@v0 - if: runner.os == 'Windows' + if: runner.os == 'Linux'