-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from hughesjs/setup-cicd
Added CICI
- Loading branch information
Showing
17 changed files
with
223 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "nuget" # See documentation for possible values | ||
directory: "/src" # Location of package manifests | ||
schedule: | ||
interval: "daily" | ||
groups: | ||
nuget-dependencies: | ||
patterns: | ||
- "*" | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
groups: | ||
actions-dependencies: | ||
patterns: | ||
- "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'csharp' ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v3 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: .NET Continuous Deployment | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
paths: | ||
- src/UniversalDiveDataFormat/** | ||
workflow_dispatch: | ||
jobs: | ||
|
||
test: | ||
name: Test Project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
- name: Run tests | ||
run: dotnet test --logger GitHubActions ./src/UniversalDiveDataFormat.sln | ||
|
||
semantic-release: | ||
needs: test | ||
name: Create a Package Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 # Need the full commit history for conventional commit | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create a GitHub release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ steps.tag_version.outputs.new_tag }} | ||
name: Release ${{ steps.tag_version.outputs.new_tag }} | ||
body: ${{ steps.tag_version.outputs.changelog }} | ||
- name: Create Nuget Package | ||
run: dotnet build -c Release ./src/UniversalDiveDataFormat/UniversalDiveDataFormat.csproj && dotnet pack -c Release -p:PackageVersion=${{ steps.tag_version.outputs.new_version }} -o . ./src/UniversalDiveDataFormat/UniversalDiveDataFormat.csproj | ||
- name: Upload Package for Publishing | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: PackedLib | ||
path: ./*.nupkg | ||
|
||
|
||
github-publish: | ||
needs: semantic-release | ||
name: Publish to Github | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download built project | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: PackedLib | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
- name: Push Package to GitHub | ||
run: dotnet nuget push --api-key ${{secrets.GITHUB_TOKEN}} --source "https://nuget.pkg.github.com/hughesjs/index.json" *.nupkg | ||
|
||
|
||
nuget-publish: | ||
needs: semantic-release | ||
name: Publish to Nuget | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download built project | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: PackedLib | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
- name: Push Package to Nuget | ||
run: dotnet nuget push --api-key ${{secrets.NUGET_KEY}} --source "https://api.nuget.org/v3/index.json" *.nupkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: .NET Continuous Integration | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
name: Test Project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
- name: Run tests | ||
run: dotnet test --logger GitHubActions ./src/UniversalDiveDataFormat.sln |
6 changes: 3 additions & 3 deletions
6
...versalDiveDataFormat/Models/BuiltTests.cs → ...DiveDataFormat.Tests/Models/BuiltTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/UniversalDiveDataFormat.Tests/Models/LaunchingDateTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System.Xml.Serialization; | ||
using Shouldly; | ||
using UniversalDiveDataFormat.ExtensionMethods; | ||
using UniversalDiveDataFormat.Models; | ||
|
||
namespace UniversalDiveDataFormat.Tests.Models; | ||
|
||
public class LaunchingDateTests | ||
{ | ||
private const string Xml = """ | ||
<launchingdate> | ||
<datetime>1943-06-14</datetime> | ||
</launchingdate> | ||
"""; | ||
|
||
[Fact] | ||
public void CanReadLaunchingDate() | ||
{ | ||
XmlSerializer serializer = new(typeof(LaunchingDate)); | ||
LaunchingDate launchingDate = serializer.Deserialize<LaunchingDate>(Xml); | ||
launchingDate.DateTime.ShouldBe(new(1943, 6, 14)); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
...t/Models/SetDiveComputerAlarmTimeTests.cs → ...s/Models/SetDiveComputerAlarmTimeTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace UniversalDiveDataFormat.Services; | ||
|
||
public class UddfDeserializer | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters