Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update develop #1045

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading