Skip to content
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
116 changes: 116 additions & 0 deletions .github/workflows/build.yml
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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

"PASSWORD" detected here, make sure this is not a hard-coded credential.

See more on https://sonarcloud.io/project/issues?id=guibranco_CrispyWaffle&issues=AZ5AVvCib4Bha3qgn32P&open=AZ5AVvCib4Bha3qgn32P&pullRequest=866

Check warning

Code scanning / SonarCloud

Credentials should not be hard-coded Medium

"PASSWORD" detected here, make sure this is not a hard-coded credential. See more on SonarQube Cloud
Comment thread
guibranco marked this conversation as resolved.
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Comment thread
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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Avoid executing downloaded artifacts directly without verification.

See more on https://sonarcloud.io/project/issues?id=guibranco_CrispyWaffle&issues=AZ5AVvCib4Bha3qgn32N&open=AZ5AVvCib4Bha3qgn32N&pullRequest=866

Check failure

Code scanning / SonarCloud

Avoid executing downloaded artifacts without verification High

Avoid executing downloaded artifacts directly without verification. See more on SonarQube Cloud
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Comment thread
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
36 changes: 0 additions & 36 deletions .github/workflows/deep-source.yml

This file was deleted.

69 changes: 0 additions & 69 deletions .github/workflows/sonarcloud.yml

This file was deleted.

143 changes: 0 additions & 143 deletions appveyor.yml

This file was deleted.

Loading