Create pr.yml (#47)

* Create dotnet.yml

* Replace dotnet.yml with pr.yml for GitHub Actions

Updated the workflow to build and test a .NET project on pull requests to the master branch. Removed the old `dotnet.yml` file and added a new `pr.yml` file with necessary steps for setup, restore, build, and test.

Updated the Visual Studio version in `GeoUK.OSTN.sln` from 16 to 17 and added a "Solution Items" section to include the new `pr.yml` file in the project structure.

* Update workflow name in pr.yml

Changed the workflow name from `.NET` to `PullRequest` for better clarity and to indicate its purpose in handling pull requests.

* Update build command to use Release configuration

Modified the `dotnet build` command to include the `--configuration Release` option. This change ensures that the build process targets the Release mode instead of the default Debug mode, enhancing the overall build process.

* Update build and test commands in pr.yml

Added `--configuration Release` to `dotnet build` and
`dotnet test` commands to ensure optimized performance
for production environments. The `--no-restore` and
`--no-build` options remain unchanged.
This commit is contained in:
Ieuan Walker
2025-07-11 12:43:54 +01:00
committed by GitHub
parent c42eee7ae5
commit 53a391e3e3
2 changed files with 30 additions and 2 deletions

23
.github/workflows/pr.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: PullRequest
on:
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal

View File

@@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16 # Visual Studio Version 17
VisualStudioVersion = 16.0.29102.190 VisualStudioVersion = 17.14.36221.1 d17.14
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeoUK.OSTN", "GeoUK.OSTN\GeoUK.OSTN.csproj", "{E7C614AC-E67D-4E04-BA4E-E1BBF4CAC6FD}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeoUK.OSTN", "GeoUK.OSTN\GeoUK.OSTN.csproj", "{E7C614AC-E67D-4E04-BA4E-E1BBF4CAC6FD}"
EndProject EndProject
@@ -15,6 +15,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{F752E48A
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeoUK.OSTN.XUnit", "Tests\GeoUK.OSTN.XUnit\GeoUK.OSTN.XUnit.csproj", "{DF00AA79-1818-4C7B-BE7E-694E955EAA3D}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeoUK.OSTN.XUnit", "Tests\GeoUK.OSTN.XUnit\GeoUK.OSTN.XUnit.csproj", "{DF00AA79-1818-4C7B-BE7E-694E955EAA3D}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8EC462FD-D22E-90A8-E5CE-7E832BA40C5D}"
ProjectSection(SolutionItems) = preProject
.github\workflows\pr.yml = .github\workflows\pr.yml
EndProjectSection
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU