Skip to content

Commit d0f078a

Browse files
authored
Merge branch 'main' into dependabot/nuget/GithubActionsHelloWorld/SixLabors.ImageSharp-3.1.3
2 parents 6814401 + ae02c6b commit d0f078a

File tree

9 files changed

+103
-59
lines changed

9 files changed

+103
-59
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "C# (.NET)",
3-
"image": "mcr.microsoft.com/devcontainers/dotnet:0-6.0",
3+
"image": "mcr.microsoft.com/devcontainers/dotnet:0-8.0",
44
"features": {
55
"ghcr.io/devcontainers/features/node:1": {},
66
"ghcr.io/devcontainers/features/dotnet:1": {}
@@ -12,16 +12,12 @@
1212
]
1313
}
1414
}
15-
1615
// Use 'forwardPorts' to make a list of ports inside the container available locally.
1716
// "forwardPorts": [5000, 5001],
18-
1917
// Use 'postCreateCommand' to run commands after the container is created.
2018
// "postCreateCommand": "dotnet restore",
21-
2219
// Configure tool-specific properties.
2320
// "customizations": {},
24-
2521
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
2622
// "remoteUser": "root"
27-
}
23+
}

.github/workflows/dotnet.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup .NET
1919
uses: actions/setup-dotnet@v4
2020
with:
21-
dotnet-version: 6.0.x
21+
dotnet-version: 8.0.x
2222
- name: Restore dependencies
2323
run: dotnet restore
2424
- name: Build
@@ -37,7 +37,7 @@ jobs:
3737
- name: Setup .NET
3838
uses: actions/setup-dotnet@v4
3939
with:
40-
dotnet-version: 6.0.x
40+
dotnet-version: 8.0.x
4141
- name: Restore dependencies
4242
run: dotnet restore
4343
- name: Build
@@ -65,7 +65,7 @@ jobs:
6565
- name: Setup .NET
6666
uses: actions/setup-dotnet@v4
6767
with:
68-
dotnet-version: 6.0.x
68+
dotnet-version: 8.0.x
6969
- name: Restore dependencies
7070
run: dotnet restore
7171
- name: Build

.vscode/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"cSpell.words": [
3+
"Codacy",
4+
"Codeuctivity",
5+
"Nuget",
6+
"Nunit",
7+
"Rasterized",
8+
"Rgba",
9+
"nupkg",
10+
"snupkg"
11+
],
12+
"editor.formatOnSave": true
13+
}

.vscode/tasks.json

Lines changed: 50 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,52 @@
11
{
2-
"version": "2.0.0",
3-
"tasks": [
4-
{
5-
"label": "build",
6-
"command": "dotnet",
7-
"type": "process",
8-
"args": [
9-
"build",
10-
"${workspaceFolder}/GithubActionsHelloWorld.csproj",
11-
"/property:GenerateFullPaths=true",
12-
"/consoleloggerparameters:NoSummary"
13-
],
14-
"problemMatcher": "$msCompile"
15-
},
16-
{
17-
"label": "publish",
18-
"command": "dotnet",
19-
"type": "process",
20-
"args": [
21-
"publish",
22-
"${workspaceFolder}/GithubActionsHelloWorld.csproj",
23-
"/property:GenerateFullPaths=true",
24-
"/consoleloggerparameters:NoSummary"
25-
],
26-
"problemMatcher": "$msCompile"
27-
},
28-
{
29-
"label": "watch",
30-
"command": "dotnet",
31-
"type": "process",
32-
"args": [
33-
"watch",
34-
"run",
35-
"${workspaceFolder}/GithubActionsHelloWorld.csproj",
36-
"/property:GenerateFullPaths=true",
37-
"/consoleloggerparameters:NoSummary"
38-
],
39-
"problemMatcher": "$msCompile"
40-
}
41-
]
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"command": "dotnet",
7+
"type": "process",
8+
"args": [
9+
"build",
10+
"${workspaceFolder}/GithubActionsHelloWorld.csproj",
11+
"/property:GenerateFullPaths=true",
12+
"/consoleloggerparameters:NoSummary"
13+
],
14+
"problemMatcher": "$msCompile"
15+
},
16+
{
17+
"label": "publish",
18+
"command": "dotnet",
19+
"type": "process",
20+
"args": [
21+
"publish",
22+
"${workspaceFolder}/GithubActionsHelloWorld.csproj",
23+
"/property:GenerateFullPaths=true",
24+
"/consoleloggerparameters:NoSummary"
25+
],
26+
"problemMatcher": "$msCompile"
27+
},
28+
{
29+
"label": "watch",
30+
"command": "dotnet",
31+
"type": "process",
32+
"args": [
33+
"watch",
34+
"run",
35+
"${workspaceFolder}/GithubActionsHelloWorld.csproj",
36+
"/property:GenerateFullPaths=true",
37+
"/consoleloggerparameters:NoSummary"
38+
],
39+
"problemMatcher": "$msCompile"
40+
},
41+
{
42+
"label": "update nuget",
43+
"command": "${workspaceFolder}/.vscode/updateNuget.sh",
44+
"args": [],
45+
"group": "build",
46+
"presentation": {
47+
"reveal": "always"
48+
},
49+
"problemMatcher": "$msCompile"
50+
}
51+
]
4252
}

.vscode/updateNuget.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
regex='PackageReference Include="([^"]*)" Version="([^"]*)"'
3+
find . -name "*.*proj" | while read proj; do
4+
while read line; do
5+
if [[ $line =~ $regex ]]; then
6+
name="${BASH_REMATCH[1]}"
7+
version="${BASH_REMATCH[2]}"
8+
if [[ $version != *-* ]]; then
9+
dotnet add "$proj" package "$name"
10+
fi
11+
fi
12+
done <"$proj"
13+
done

GithubActionsHelloWorld/GithubActionsHelloWorld.csproj

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<Version Condition="'$(CURRENT_VERSION)' != ''">$(CURRENT_VERSION)</Version>
77
<Version Condition="'$(CURRENT_VERSION)' == ''">0.0.1</Version>
88
<AssemblyVersion>$(Version)</AssemblyVersion>
@@ -20,11 +20,8 @@
2020
</PropertyGroup>
2121

2222
<ItemGroup>
23-
24-
2523
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.3" />
26-
<PackageReference Include="ZXing.Net" Version="0.16.9" />
27-
24+
<PackageReference Include="ZXing.Net" Version="0.16.10" />
2825
</ItemGroup>
2926

3027
</Project>

GithubActionsHelloWorldTests/GithubActionsHelloWorldTest.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using GithubActionsHelloWorld;
2+
using System;
3+
using System.Threading;
24
using System.Threading.Tasks;
35
using Xunit;
46

@@ -12,5 +14,17 @@ public async Task Main_ShouldRunWithoutError()
1214
var args = new string[] { "SomeParameter" };
1315
await Program.Main(args);
1416
}
17+
18+
[Fact]
19+
public void ShouldDoTheSameThingOnEachGHARunner()
20+
{
21+
Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
22+
23+
string expected = "09/02/2010 00:00:00";
24+
DateTime parsedDate = DateTime.Parse(expected);
25+
var actual = parsedDate.ToString();
26+
27+
Assert.Equal(expected, actual);
28+
}
1529
}
1630
}

GithubActionsHelloWorldTests/GithubActionsHelloWorldTests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
11-
<PackageReference Include="xunit" Version="2.4.1" />
12-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
11+
<PackageReference Include="xunit" Version="2.9.2" />
12+
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
1313
<PrivateAssets>all</PrivateAssets>
1414
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1515
</PackageReference>
16-
<PackageReference Include="coverlet.collector" Version="6.0.0">
16+
<PackageReference Include="coverlet.collector" Version="6.0.3">
1717
<PrivateAssets>all</PrivateAssets>
1818
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1919
</PackageReference>

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# GithubActionsHelloWorld
22

33
[![.NET](https://github.com/stesee/GithubActionsHelloWorld/actions/workflows/dotnet.yml/badge.svg)](https://github.com/stesee/GithubActionsHelloWorld/actions/workflows/dotnet.yml)
4+
[![NuGet](https://img.shields.io/badge/nuget-GithubActionsHelloWorld-blue)](https://int.nugettest.org/packages/GithubActionsHelloWorld)
45

56
Hello world built with github action.

0 commit comments

Comments
 (0)