diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..005911b2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: CI + +on: + push: + branches: [ "main" ] + +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: Build with dotnet + run: dotnet build --configuration Release + + - name: dotnet publish + run: dotnet publish src/GitHubActionsDotNet.Api/GitHubActionsDotNet.Api.csproj --configuration Release -o artifacts diff --git a/.github/workflows/pr-verify.yml b/.github/workflows/pr-verify.yml index 3243ea4b..de3e9910 100644 --- a/.github/workflows/pr-verify.yml +++ b/.github/workflows/pr-verify.yml @@ -19,3 +19,9 @@ jobs: - name: Build with dotnet 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 \ No newline at end of file diff --git a/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs b/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs index f03d0f47..78c1a4c1 100644 --- a/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs +++ b/src/GitHubActionsDotNet.Api.Tests/Models/WeatherForecastTests.cs @@ -13,5 +13,6 @@ public void TemperatureFShouldReturnCorrectValueBasedOnTemperatureC() }; weatherForecast.TemperatureF.Should().Be(32); + weatherForecast.TemperatureF.Should().Be(32); } } diff --git a/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs b/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs index 786b4a10..67da0a38 100644 --- a/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs +++ b/src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs @@ -10,3 +10,5 @@ public record WeatherForecast public string? Summary { get; init; } } + +