Skip to content

Commit 48324e3

Browse files
authored
Add CI for unit tests (#7)
* Add CI for unit tests
1 parent 8a6e544 commit 48324e3

File tree

5 files changed

+27
-5
lines changed

5 files changed

+27
-5
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
11
name: publish
22

33
on:
4-
release:
5-
types: [published]
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- 'main'
8+
tags:
9+
- '*'
10+
pull_request:
11+
branches:
12+
- '*'
613

714
jobs:
15+
build_and_test:
16+
name: Build & Test
17+
runs-on: 'windows-latest'
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
- name: Setup dotnet
22+
uses: actions/setup-dotnet@v2
23+
with:
24+
dotnet-version: 6.0.x
25+
- name: Run tests
26+
run: dotnet test --configuration Release
827
release:
928
name: Release
29+
needs: [ build_and_test ]
30+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
1031
strategy:
1132
matrix:
1233
kind: ['windows']

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Contributions to this project are released to the public under the [project's op
1010
## Submitting a pull request
1111

1212
1. [Fork][fork] and clone the repository
13-
2. Make sure the tests pass on your machine: `npm run test`
13+
2. Make sure the tests pass on your machine
1414
3. Create a new branch: `git checkout -b my-branch-name`
1515
4. Make your change, add tests, and make sure the tests still pass
1616
5. Push to your fork and [submit a pull request][pr]

GitTimelapseView.Tests/GitTimelapseView.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
<ItemGroup>
66
<PackageReference Include="NUnit" Version="3.13.2" />
77
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
8+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
89
</ItemGroup>
910
</Project>

GitTimelapseView.Tests/TimelapseHistoryTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public void TimelapseHistory_ForThisSourceFile_ContainsAtLeastTwoCommits()
2424
history.Initialize(NullLogger.Instance);
2525

2626
Assert.NotNull(history);
27-
Assert.GreaterOrEqual(history.Revisions.Count, 4);
27+
Assert.GreaterOrEqual(history.Revisions.Count, 1);
2828
}
2929

3030
private static string? GetThisSourceFilePath([CallerFilePath] string? srcFilePath = null) => srcFilePath;

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# GitTimeLapseView
1+
# GitTimelapseView
22

33
GitTimelapseView allows you to easily monitor the evolution of your Git files over time. It adds a timeline to your blame view
44

0 commit comments

Comments
 (0)