-
Notifications
You must be signed in to change notification settings - Fork 20
Create build.yml #866
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
Create build.yml #866
Changes from all commits
1cb5fdf
b5622f3
daa8242
4f21909
d61a4db
5276ca7
88d485e
b38fa20
94081fa
0191ce7
50664bf
d9085d1
18bf3b6
36d7739
36a9e11
2226afc
17a3ea8
7436611
ef90f19
ad6ebb2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| name: Build, Test and Analyze | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ci-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build, Test and Analyze | ||
| runs-on: ubuntu-latest | ||
|
|
||
| services: | ||
| couchdb: | ||
| image: couchdb:3.3.3 | ||
| env: | ||
| COUCHDB_USER: Admin | ||
| COUCHDB_PASSWORD: myP@ssw0rd | ||
|
Check warning on line 25 in .github/workflows/build.yml
|
||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
github-advanced-security[bot] marked this conversation as resolved.
Fixed
guibranco marked this conversation as resolved.
Dismissed
|
||
| ports: | ||
| - 5984:5984 | ||
| options: >- | ||
| --health-cmd "curl -sf http://localhost:5984/_up" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 10 | ||
|
|
||
| steps: | ||
| - name: 📥 Checkout repository | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
| fetch-depth: 0 | ||
|
|
||
| - name: ☕ Setup Java runtime | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| java-version: 17 | ||
| distribution: temurin | ||
|
|
||
| - name: 🧰 Setup .NET SDK | ||
| uses: actions/setup-dotnet@v5 | ||
| with: | ||
| dotnet-version: '10.0.x' | ||
|
|
||
| - name: 🔧 Install SonarCloud scanner | ||
| run: dotnet tool install --global dotnet-sonarscanner | ||
|
|
||
| - name: 📡 Install DeepSource scanner | ||
| run: curl https://deepsource.io/cli | sh | ||
|
Check failure on line 56 in .github/workflows/build.yml
|
||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
github-advanced-security[bot] marked this conversation as resolved.
Fixed
guibranco marked this conversation as resolved.
Dismissed
|
||
|
|
||
| - name: 💾 Cache NuGet packages | ||
| uses: actions/cache@v5 | ||
| with: | ||
| path: ~/.nuget/packages | ||
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/global.json', '**/packages.lock.json') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-nuget- | ||
| - name: 📦 Restore dependencies | ||
| run: dotnet restore | ||
|
|
||
| - name: 🔍 Begin SonarCloud analysis | ||
| run: | | ||
| dotnet sonarscanner begin \ | ||
| /k:"guibranco_CrispyWaffle" \ | ||
| /o:"guibranco" \ | ||
| /d:sonar.token="$SONAR_TOKEN" \ | ||
| /d:sonar.host.url="https://sonarcloud.io" \ | ||
| /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
|
|
||
| - name: 🏗️ Build solution | ||
| run: dotnet build --no-restore --configuration Release | ||
|
|
||
| - name: 🧪 Run tests with coverage | ||
| run: | | ||
| dotnet test \ | ||
| --no-build \ | ||
| --configuration Release \ | ||
| /p:CollectCoverage=true \ | ||
| /p:CoverletOutputFormat=opencover%2ccobertura | ||
|
|
||
| - name: 📊 End SonarCloud analysis | ||
| run: dotnet sonarscanner end /d:sonar.token="$SONAR_TOKEN" | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
|
|
||
| - name: ☂️ Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v6 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
|
|
||
| - name: 📈 Report coverage to DeepSource | ||
| if: >- | ||
| ( | ||
| github.event_name == 'pull_request' && | ||
| github.event.pull_request.head.repo.full_name == github.repository | ||
| ) || ( | ||
| github.event_name == 'workflow_dispatch' | ||
| ) | ||
| env: | ||
| DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }} | ||
| run: | | ||
| ./bin/deepsource report \ | ||
| --analyzer test-coverage \ | ||
| --key csharp \ | ||
| --value-file ./Tests/CrispyWaffle.Tests/coverage.net9.0.cobertura.xml | ||
This file was deleted.
This file was deleted.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.