Skip to content

Commit

Permalink
Update master (#1044)
Browse files Browse the repository at this point in the history
* Update 'Setup' section in README.md

* Add 'TrustServerCertificate=true' to connection string template

* Fixed seeding (#872)

* Fixed seeding

* Fixed inability to update streetcode 1

* Fixed additional text

* Changed job description length limit (#1006)

* Fix sonarcloud 3 (#970)

* add swagger for stage and local

* Changed datestring max length to 100 instead of 50 (#901) (#933)

* fix sonar

* Update fix sonar

---------

Co-authored-by: Vitalii <[email protected]>
Co-authored-by: Andrii Malynovskyi <[email protected]>
Co-authored-by: Adeodonne <[email protected]>
Co-authored-by: Bohdan Bozhyk <[email protected]>

---------

Co-authored-by: Ivan Yadchyshyn <[email protected]>
Co-authored-by: Ivan Yadchyshyn <[email protected]>
Co-authored-by: Andrii Malynovskyi <[email protected]>
Co-authored-by: Kateryna Yatsiuk <[email protected]>
Co-authored-by: Valentyn Zamykhivskyi <[email protected]>
Co-authored-by: Vitalii <[email protected]>
Co-authored-by: Adeodonne <[email protected]>
Co-authored-by: Bohdan Bozhyk <[email protected]>
  • Loading branch information
9 people authored Jan 11, 2024
1 parent b401390 commit 214b2a4
Show file tree
Hide file tree
Showing 8 changed files with 2,864 additions and 1,451 deletions.
43 changes: 15 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,50 +15,37 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Java
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
distribution: 'temurin'
java-version: '17'
overwrite-settings: false

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

- name: Install dotnet-coverage
run: dotnet tool install --global dotnet-coverage

- name: Install dotnet-sonarscanner
run: dotnet tool install --global dotnet-sonarscanner

- name: Restore Dependencies
run: dotnet restore ./Streetcode/Streetcode.sln

- name: Install xmldocmd
run: dotnet tool install xmldocmd -g

- name: Build
run: dotnet build ./Streetcode/Streetcode.sln --configuration Release --no-restore

- name: Install coverlet.console
run: dotnet tool install -g coverlet.console

- name: Test and Code Coverage
run: |
dotnet test ./Streetcode/Streetcode.XUnitTest/Streetcode.XUnitTest.csproj --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=./coverage/coverage.xml
- name: Install SonarScanner
run: dotnet tool install --global dotnet-sonarscanner

- name: Set SonarCloud Token
run: echo "SONAR_TOKEN=${{ secrets.SONAR_TOKEN }}" >> $GITHUB_ENV
run: dotnet-coverage collect "dotnet test ./Streetcode/Streetcode.XUnitTest/Streetcode.XUnitTest.csproj --configuration Release --results-directory ./coverage --logger trx" -f xml -o coverage.xml

- name: SonarScanner Analysis
id: sonar
run: |
dotnet sonarscanner begin /k:"ita-social-projects_StreetCode" /o:"ita-social-projects" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportPaths="./coverage/coverage.xml"
dotnet build ./Streetcode/Streetcode.sln --configuration Release
dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
- name: Publish Code Coverage Report
if: always()
uses: actions/upload-artifact@v2
with:
name: Code Coverage Report
path: |
./coverage/coverage.xml
dotnet sonarscanner begin /k:"ita-social-projects_StreetCode" /o:"ita-social-projects" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths="**/coverage.xml"
dotnet build ./Streetcode/Streetcode.sln --configuration Release
dotnet test ./Streetcode/Streetcode.XUnitTest/Streetcode.XUnitTest.csproj --configuration Release --no-build --verbosity normal
dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,22 @@ [email protected]:ita-social-projects/StreetCode.git
```

### Setup
1. Change connection string
(Go to **appsettings.json** and write your local database connection string)
2. Create local database
(Run project and make sure that database was created filled with data)

**1. Change connection string**
* Go to `appsettings.Local.json` in **StreetCode.WebApi** project and write your local database connection string in following format:

```
Server={local_server_name};Database=StreetcodeDb;User Id={username};Password={password};MultipleActiveResultSets=true;TrustServerCertificate=true;
```
**2. Add database seeding**
- Go to `Program.cs` in **StreetCode.WebApi** project and add following code:
```csharp
await app.SeedDataAsync();
```
**3. Create and seed local database**
* Run project and make sure that database was created and filled with data
### How to run local
Run the Streetcode project than open your browser and enter https://localhost:5001/swagger/index.html url. If you had this page already opened, just reload it.
Expand Down
2 changes: 1 addition & 1 deletion Streetcode/Streetcode.DAL/Entities/Jobs/Job.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class Job
public bool Status { get; set; }

[Required]
[MaxLength(2000)]
[MaxLength(3000)]
public string Description { get; set; }

[Required]
Expand Down
186 changes: 27 additions & 159 deletions Streetcode/Streetcode.DAL/InitialData/images.json

Large diffs are not rendered by default.

Loading

0 comments on commit 214b2a4

Please sign in to comment.