Skip to content

Commit

Permalink
Pin .NET SDK version (#151)
Browse files Browse the repository at this point in the history
* force .NET SDK 7.0.105 because of dotnet format bug

* uncomment EnforceCodeStyleInBuild in csproj

not needed with .NET SDK 7.0.105

* fix launchSettings.json

* README: fix instructions to run from CLI
  • Loading branch information
Dalet authored Jun 4, 2023
1 parent c5b9fc4 commit 777ff4f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup dotnet 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x'
dotnet-version: '7.0.105' # required because of dotnet format bug
- name: Restore NuGet packages
run: dotnet restore
- name: Restore tools
Expand Down
3 changes: 1 addition & 2 deletions LeaderboardBackend.Test/LeaderboardBackend.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<!-- Commenting out due to dotnet format bug: https://github.com/dotnet/format/issues/1800 -->
<!-- <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> -->
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions LeaderboardBackend/LeaderboardBackend.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<!-- Commenting out due to dotnet format bug: https://github.com/dotnet/format/issues/1800 -->
<!-- <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> -->
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

<PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions LeaderboardBackend/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"profiles": {
"LeaderboardBackendCsPoc": {
"LeaderboardBackend": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "https://localhost:7128;http://localhost:5240"
"applicationUrl": "https://localhost:8080;http://localhost:8000"
},
"IIS Express": {
"commandName": "IISExpress",
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,18 @@ dotnet ef database update

#### Run the App

To run the application from the CLI, run the following command from the root of the project:
To run the application from the CLI, run the following command from the root of the repository:

```bash
cd LeaderboardBackend
dotnet run # or `dotnet watch` to run with hot reload
```
dotnet run --project LeaderboardBackend --urls https://localhost:7128 // dotnet watch run ... for hotfixing
```

The value provided to `--urls` has to match what's listed under `applicationUrl` in `LeaderboardBackend/Properties/launchSettings.json`. As of this writing, it's `https://localhost:7128`.

#### Test the App
Docker is required to run integration tests against a real Postgres database.
However, if you would still like to run the tests with an in-memory database, you can set the following environment variable: `INTEGRATION_TESTS_DB_BACKEND=InMemory`.

To run the tests, run the following commands from the root of the project:
To run the tests, run the following commands from the root of the repository:

```bash
cd LeaderboardBackend.Test
Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "7.0.105"
}
}

0 comments on commit 777ff4f

Please sign in to comment.