diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cef5a43..a131eba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,26 +16,21 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: ./ + - name: Setup dotnet + uses: actions/setup-dotnet@v1 with: - path: "*.xml" - access-token: ${{secrets.GITHUB_TOKEN}} + dotnet-version: "3.1.100" - release: - runs-on: ubuntu-latest - needs: [build, test] - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: Run Tests + run: dotnet test --logger:nunit - - name: Release - uses: cycjimmy/semantic-release-action@v2 + - uses: ./ + if: always() with: - extra_plugins: | - @semantic-release/exec - @semantic-release/changelog - @semantic-release/git - branch: master + path: "TestResults/*.xml" + access-token: ${{secrets.GITHUB_TOKEN}} + - name: Publish + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + run: npx semantic-release env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/.gitignore b/.gitignore index 18e337d..48ce4a4 100644 --- a/.gitignore +++ b/.gitignore @@ -96,4 +96,8 @@ Thumbs.db # Ignore built ts files __tests__/runner/* -lib/**/* \ No newline at end of file +lib/**/* + +bin +obj +TestResults \ No newline at end of file diff --git a/UnitTest1.cs b/UnitTest1.cs new file mode 100644 index 0000000..bdc5e3d --- /dev/null +++ b/UnitTest1.cs @@ -0,0 +1,31 @@ +using System; +using NUnit.Framework; + +namespace nunit_reporter +{ + public class Tests + { + [SetUp] + public void Setup() + { + } + + [Test] + public void PassingTest() + { + Assert.Pass(); + } + + [Test] + public void FailingTest() + { + Assert.Fail("This test should fail"); + } + + [Test] + public void TestWithException() + { + throw new InvalidOperationException("Some error happened"); + } + } +} \ No newline at end of file diff --git a/nunit-reporter.csproj b/nunit-reporter.csproj new file mode 100644 index 0000000..b847fcd --- /dev/null +++ b/nunit-reporter.csproj @@ -0,0 +1,17 @@ + + + + netcoreapp3.1 + nunit_reporter + + false + + + + + + + + + +