Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Run example PR [DO NOT MERGE] #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 13 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,8 @@ Thumbs.db

# Ignore built ts files
__tests__/runner/*
lib/**/*
lib/**/*

bin
obj
TestResults
31 changes: 31 additions & 0 deletions UnitTest1.cs
Original file line number Diff line number Diff line change
@@ -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");
}
}
}
17 changes: 17 additions & 0 deletions nunit-reporter.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>nunit_reporter</RootNamespace>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="NunitXml.TestLogger" Version="2.1.41" />
</ItemGroup>

</Project>