From 314cb47172b1e2ac851b35c6ec18ce2bef5d2fa6 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 21 Jan 2025 15:54:26 -0800 Subject: [PATCH 01/14] ActionConfig --- .github/workflows/pr-verify.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/pr-verify.yml diff --git a/.github/workflows/pr-verify.yml b/.github/workflows/pr-verify.yml new file mode 100644 index 00000000..d7c568bc --- /dev/null +++ b/.github/workflows/pr-verify.yml @@ -0,0 +1,22 @@ +name: PR Verify + +on: + pull_request: + branches: [ "main" ] + workflow_dispatch: + +jobs: + build: + name: PR Verify + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0 + + - name: Build with dotnet + run: dotnet build --configuration Release \ No newline at end of file From 9534e708289f47922be2a6c9dc8d9f70e1f8087f Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 21 Jan 2025 16:17:03 -0800 Subject: [PATCH 02/14] Added new line to weather forecast model --- src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs b/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs index 786b4a10..efe721f3 100644 --- a/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs +++ b/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs @@ -10,3 +10,4 @@ public record WeatherForecast public string? Summary { get; init; } } + From ced6fb5cbed58c14df603fba44bba1e45c4e9faa Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 21 Jan 2025 16:27:00 -0800 Subject: [PATCH 03/14] break the build --- src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs b/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs index efe721f3..349e7ef8 100644 --- a/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs +++ b/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs @@ -11,3 +11,4 @@ public record WeatherForecast public string? Summary { get; init; } } +} \ No newline at end of file From e71fd341f0439eeaebc0957182ccc29885174529 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 21 Jan 2025 16:41:17 -0800 Subject: [PATCH 04/14] fixed the build --- src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs b/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs index 349e7ef8..88d9fbb3 100644 --- a/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs +++ b/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs @@ -9,6 +9,4 @@ public record WeatherForecast public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); public string? Summary { get; init; } -} - } \ No newline at end of file From d3ce5267e0aefa38062a5c13752dff1b9f9a1f87 Mon Sep 17 00:00:00 2001 From: Michael-Baucum <137816320+Michael-Baucum@users.noreply.github.com> Date: Tue, 21 Jan 2025 16:42:02 -0800 Subject: [PATCH 05/14] Added new line to weather forecast model (#1) * Added new line to weather forecast model * break the build --------- Co-authored-by: Michael --- src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs b/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs index 786b4a10..88d9fbb3 100644 --- a/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs +++ b/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs @@ -9,4 +9,4 @@ public record WeatherForecast public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); public string? Summary { get; init; } -} +} \ No newline at end of file From 00f51f66096d1874e81df68a3a73191ec067df9d Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 21 Jan 2025 16:49:48 -0800 Subject: [PATCH 06/14] change to action test --- .github/workflows/pr-verify.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-verify.yml b/.github/workflows/pr-verify.yml index d7c568bc..3e3e71c8 100644 --- a/.github/workflows/pr-verify.yml +++ b/.github/workflows/pr-verify.yml @@ -19,4 +19,7 @@ jobs: dotnet-version: 8.0 - name: Build with dotnet - run: dotnet build --configuration Release \ No newline at end of file + run: dotnet build --configuration Release + + - name: dotnet test + run: dotnet test --configuration Release --no-build \ No newline at end of file From 85a1a9b1e53f2de6e3631ca4bad1604da6e65508 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 22 Jan 2025 12:16:52 -0800 Subject: [PATCH 07/14] breaking test --- .../Models/WeatherForecastTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs b/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs index f03d0f47..32811ed6 100644 --- a/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs +++ b/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs @@ -12,6 +12,6 @@ public void TemperatureFShouldReturnCorrectValueBasedOnTemperatureC() TemperatureC = 0 }; - weatherForecast.TemperatureF.Should().Be(32); + weatherForecast.TemperatureF.Should().Be(31); } } From e105142928e903d816c6efcac978b22914610469 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 22 Jan 2025 12:27:50 -0800 Subject: [PATCH 08/14] fixed test --- .../Models/WeatherForecastTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs b/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs index 32811ed6..f03d0f47 100644 --- a/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs +++ b/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs @@ -12,6 +12,6 @@ public void TemperatureFShouldReturnCorrectValueBasedOnTemperatureC() TemperatureC = 0 }; - weatherForecast.TemperatureF.Should().Be(31); + weatherForecast.TemperatureF.Should().Be(32); } } From 4a16b79abbc69ce0f3f65df5f027c91da1e751bb Mon Sep 17 00:00:00 2001 From: Michael-Baucum <137816320+Michael-Baucum@users.noreply.github.com> Date: Wed, 22 Jan 2025 12:29:02 -0800 Subject: [PATCH 09/14] Testing (#2) * Added new line to weather forecast model * break the build * fixed the build * change to action test * breaking test --------- Co-authored-by: Michael --- .github/workflows/pr-verify.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-verify.yml b/.github/workflows/pr-verify.yml index d7c568bc..3e3e71c8 100644 --- a/.github/workflows/pr-verify.yml +++ b/.github/workflows/pr-verify.yml @@ -19,4 +19,7 @@ jobs: dotnet-version: 8.0 - name: Build with dotnet - run: dotnet build --configuration Release \ No newline at end of file + run: dotnet build --configuration Release + + - name: dotnet test + run: dotnet test --configuration Release --no-build \ No newline at end of file From 0a057d957ca7aec9d11e1d5d8fd1ba324b7c4367 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 22 Jan 2025 14:09:39 -0800 Subject: [PATCH 10/14] break format --- .github/workflows/pr-verify.yml | 5 ++++- .../GitHubActionsDotNet.Api.Tests.csproj | 12 ++++++------ .../Models/WeatherForecastTests.cs | 4 +++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr-verify.yml b/.github/workflows/pr-verify.yml index 3e3e71c8..f634984e 100644 --- a/.github/workflows/pr-verify.yml +++ b/.github/workflows/pr-verify.yml @@ -22,4 +22,7 @@ jobs: run: dotnet build --configuration Release - name: dotnet test - run: dotnet test --configuration Release --no-build \ No newline at end of file + run: dotnet test --configuration Release --no-build + + - name: dotnet format + run: dotnet format -v detailed --verify-no-changes \ No newline at end of file diff --git a/src/GitHubActionsDotNet.Api.Tests/GitHubActionsDotNet.Api.Tests.csproj b/src/GitHubActionsDotNet.Api.Tests/GitHubActionsDotNet.Api.Tests.csproj index 424bab8f..c8d83d3b 100644 --- a/src/GitHubActionsDotNet.Api.Tests/GitHubActionsDotNet.Api.Tests.csproj +++ b/src/GitHubActionsDotNet.Api.Tests/GitHubActionsDotNet.Api.Tests.csproj @@ -11,15 +11,15 @@ - - - - - + + + + + - + diff --git a/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs b/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs index f03d0f47..4c329652 100644 --- a/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs +++ b/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs @@ -1,7 +1,9 @@ namespace GitHubActionsDotNet.Api.Tests; + using FluentAssertions; using GitHubActionsDotNet.Api.Models; + public class WeatherForecastTests { [Fact] @@ -12,6 +14,6 @@ public void TemperatureFShouldReturnCorrectValueBasedOnTemperatureC() TemperatureC = 0 }; - weatherForecast.TemperatureF.Should().Be(32); + weatherForecast.TemperatureF.Should().Be(32); } } From 7e5fa122d206abac026a668808ccb0f1bdbde6aa Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 22 Jan 2025 14:13:12 -0800 Subject: [PATCH 11/14] fixed brokenb test format --- .../Models/WeatherForecastTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs b/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs index 4c329652..4961f8b7 100644 --- a/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs +++ b/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs @@ -14,6 +14,6 @@ public void TemperatureFShouldReturnCorrectValueBasedOnTemperatureC() TemperatureC = 0 }; - weatherForecast.TemperatureF.Should().Be(32); + weatherForecast.TemperatureF.Should().Be(32); } } From 712c60d944cd6a2e4a45207732719e54b9106e5a Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 22 Jan 2025 14:14:47 -0800 Subject: [PATCH 12/14] fixed brokenb test format --- src/GitHubActionsDotNet.Api/GitHubActionsDotNet.Api.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitHubActionsDotNet.Api/GitHubActionsDotNet.Api.csproj b/src/GitHubActionsDotNet.Api/GitHubActionsDotNet.Api.csproj index f18b2634..5b4d518c 100644 --- a/src/GitHubActionsDotNet.Api/GitHubActionsDotNet.Api.csproj +++ b/src/GitHubActionsDotNet.Api/GitHubActionsDotNet.Api.csproj @@ -11,4 +11,4 @@ - + \ No newline at end of file From 8d51633477aca7404565f6f4c200baeb730f92ec Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 22 Jan 2025 14:36:25 -0800 Subject: [PATCH 13/14] ci testing --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..f4a2299d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: CI + +on: + push: + branches: [ "main" ] + workflow_dispatch: + +jobs: + build: + name: CI + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0 + + - name: dotnet test + run: dotnet test --configuration Release + + - name: dotnet publish + run: dotnet publish src/GitHubActionsDotNet.Api/GitHubActionsDotNet.Api.csproj --configuration Release -o artifacts From eb116a77dea6dbeff295a0c752268865068187de Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 22 Jan 2025 14:41:09 -0800 Subject: [PATCH 14/14] took away formatting its broken --- .github/workflows/pr-verify.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/pr-verify.yml b/.github/workflows/pr-verify.yml index 3866aa53..3e3e71c8 100644 --- a/.github/workflows/pr-verify.yml +++ b/.github/workflows/pr-verify.yml @@ -22,7 +22,4 @@ jobs: run: dotnet build --configuration Release - name: dotnet test - run: dotnet test --configuration Release --no-build - - - name: dotnet format - run: dotnet format -v detailed --verify-no-changes + run: dotnet test --configuration Release --no-build \ No newline at end of file