Skip to content

Commit

Permalink
Add CI for unit tests (#7)
Browse files Browse the repository at this point in the history
* Add CI for unit tests
  • Loading branch information
LaurentM-Ubi authored Apr 25, 2022
1 parent 8a6e544 commit 48324e3
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
name: publish

on:
release:
types: [published]
workflow_dispatch:
push:
branches:
- 'main'
tags:
- '*'
pull_request:
branches:
- '*'

jobs:
build_and_test:
name: Build & Test
runs-on: 'windows-latest'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Run tests
run: dotnet test --configuration Release
release:
name: Release
needs: [ build_and_test ]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
strategy:
matrix:
kind: ['windows']
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Contributions to this project are released to the public under the [project's op
## Submitting a pull request

1. [Fork][fork] and clone the repository
2. Make sure the tests pass on your machine: `npm run test`
2. Make sure the tests pass on your machine
3. Create a new branch: `git checkout -b my-branch-name`
4. Make your change, add tests, and make sure the tests still pass
5. Push to your fork and [submit a pull request][pr]
Expand Down
1 change: 1 addition & 0 deletions GitTimelapseView.Tests/GitTimelapseView.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
<ItemGroup>
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion GitTimelapseView.Tests/TimelapseHistoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void TimelapseHistory_ForThisSourceFile_ContainsAtLeastTwoCommits()
history.Initialize(NullLogger.Instance);

Assert.NotNull(history);
Assert.GreaterOrEqual(history.Revisions.Count, 4);
Assert.GreaterOrEqual(history.Revisions.Count, 1);
}

private static string? GetThisSourceFilePath([CallerFilePath] string? srcFilePath = null) => srcFilePath;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GitTimeLapseView
# GitTimelapseView

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

Expand Down

0 comments on commit 48324e3

Please sign in to comment.