Fetch Data - Unsupported Commands #453
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#CI/MANUAL TRIGGER | |
name: Build / Test | |
on: | |
push: | |
branches: [ main, dev ] | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
# Build/Test | |
OS-NetCore: | |
name: Build/Test (.NET Core) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ windows-2022, ubuntu-22.04, macOS-14 ] | |
dotnet-version: [ '3.1.x', '5.0.x', '6.0.x', '7.0.x', '8.0.x', '9.0.x' ] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Dotnet Version (${{ matrix.dotnet-version }}) | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- name: Find And Replace Values (App Settings) | |
uses: abhinavminhas/replace-tokens@main | |
with: | |
files: '${{ github.workspace }}/QueryDB.Core.Tests/appsettings.json' | |
replacements: '__DB_PASSWORD__=${{ secrets.DB_PASSWORD }},__DB_PASSWORD__=${{ secrets.DB_PASSWORD }},__DB_PASSWORD__=${{ secrets.DB_PASSWORD }},__DB_PASSWORD__=${{ secrets.DB_PASSWORD }}' | |
- name: Build (${{ matrix.dotnet-version }}) | |
shell: bash | |
run: | | |
if [[ "${{ matrix.dotnet-version }}" == "3.1"* ]]; then | |
dotnet build -f netcoreapp3.1 QueryDB.Core.Tests/QueryDB.Core.Tests.csproj --configuration Release | |
elif [[ "${{ matrix.dotnet-version }}" == "5.0"* ]]; then | |
dotnet build -f net5.0 QueryDB.Core.Tests/QueryDB.Core.Tests.csproj --configuration Release | |
elif [[ "${{ matrix.dotnet-version }}" == "6.0"* ]]; then | |
dotnet build -f net6.0 QueryDB.Core.Tests/QueryDB.Core.Tests.csproj --configuration Release | |
elif [[ "${{ matrix.dotnet-version }}" == "7.0"* ]]; then | |
dotnet build -f net7.0 QueryDB.Core.Tests/QueryDB.Core.Tests.csproj --configuration Release | |
elif [[ "${{ matrix.dotnet-version }}" == "8.0"* ]]; then | |
dotnet build -f net8.0 QueryDB.Core.Tests/QueryDB.Core.Tests.csproj --configuration Release | |
elif [[ "${{ matrix.dotnet-version }}" == "9.0"* ]]; then | |
dotnet build -f net9.0 QueryDB.Core.Tests/QueryDB.Core.Tests.csproj --configuration Release | |
fi | |
- name: Docker Compose (Start - DB Containers) | |
if: ${{ (matrix.os == 'ubuntu-22.04') && (matrix.dotnet-version == '3.1.x') }} | |
uses: ./.github/workflows/docker-compose-start-dbs | |
with: | |
dbPassword: ${{ secrets.DB_PASSWORD }} | |
- name: Docker Inspect (Health Check - DB Containers) | |
if: ${{ (matrix.os == 'ubuntu-22.04') && (matrix.dotnet-version == '3.1.x') }} | |
uses: ./.github/workflows/docker-inspect-health-check | |
with: | |
dbPassword: ${{ secrets.DB_PASSWORD }} | |
- name: Docker Execute (Seed Data) | |
if: ${{ (matrix.os == 'ubuntu-22.04') && (matrix.dotnet-version == '3.1.x') }} | |
uses: ./.github/workflows/docker-execute-seed-data | |
with: | |
dbPassword: ${{ secrets.DB_PASSWORD }} | |
- name: Test (${{ matrix.dotnet-version }}) | |
if: ${{ (matrix.os == 'ubuntu-22.04') && (matrix.dotnet-version == '3.1.x') }} | |
run: dotnet test --framework netcoreapp3.1 --no-build --logger "console;verbosity=detailed" --verbosity normal --configuration Release --filter TestCategory=DB-TESTS | |
- name: Docker Compose (Tear Down - DB Containers) | |
if: ${{ (matrix.os == 'ubuntu-22.04') && (matrix.dotnet-version == '3.1.x') && always() }} | |
uses: ./.github/workflows/docker-compose-teardown-dbs | |
# Code Coverage | |
Code-Coverage: | |
name: Code Coverage (Codecov) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-22.04 ] | |
dotnet-version: [ '3.1.x' ] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Dotnet Version (${{ matrix.dotnet-version }}) | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- name: Find And Replace Values (App Settings) | |
uses: abhinavminhas/replace-tokens@main | |
with: | |
files: '${{ github.workspace }}/QueryDB.Core.Tests/appsettings.json' | |
replacements: '__DB_PASSWORD__=${{ secrets.DB_PASSWORD }},__DB_PASSWORD__=${{ secrets.DB_PASSWORD }},__DB_PASSWORD__=${{ secrets.DB_PASSWORD }},__DB_PASSWORD__=${{ secrets.DB_PASSWORD }}' | |
- name: Build (${{ matrix.dotnet-version }}) | |
run: dotnet build -f netcoreapp3.1 QueryDB.Core.Tests/QueryDB.Core.Tests.csproj --configuration Release | |
- name: Docker Compose (Start - DB Containers) | |
uses: ./.github/workflows/docker-compose-start-dbs | |
with: | |
dbPassword: ${{ secrets.DB_PASSWORD }} | |
- name: Docker Inspect (Health Check - DB Containers) | |
uses: ./.github/workflows/docker-inspect-health-check | |
with: | |
dbPassword: ${{ secrets.DB_PASSWORD }} | |
- name: Docker Execute (Seed Data) | |
uses: ./.github/workflows/docker-execute-seed-data | |
with: | |
dbPassword: ${{ secrets.DB_PASSWORD }} | |
- name: Test (${{ matrix.dotnet-version }}) | |
run: dotnet test --framework netcoreapp3.1 --no-build --logger "console;verbosity=detailed" --verbosity normal --configuration Release --filter TestCategory=DB-TESTS /p:CollectCoverage=true /p:CoverletOutputFormat=lcov | |
- name: Docker Compose (Tear Down - DB Containers) | |
if: always() | |
uses: ./.github/workflows/docker-compose-teardown-dbs | |
- name: Upload Coverage To Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
# Code Quality | |
Code-Quality: | |
name: Code Quality (SonarCloud) | |
runs-on: windows-2022 | |
steps: | |
- name: Set Up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'zulu' | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Cache SonarCloud Packages | |
uses: actions/cache@v4 | |
with: | |
path: ~\sonar\cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Cache SonarCloud Scanner | |
id: cache-sonar-scanner | |
uses: actions/cache@v4 | |
with: | |
path: .\.sonar\scanner | |
key: ${{ runner.os }}-sonar-scanner | |
restore-keys: ${{ runner.os }}-sonar-scanner | |
- name: Install SonarCloud Scanner | |
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' | |
shell: powershell | |
run: | | |
New-Item -Path .\.sonar\scanner -ItemType Directory | |
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner | |
- name: Build And Analyze | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
shell: powershell | |
run: | | |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"abhinavminhas_QueryDB" /o:"abhinavminhas" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" | |
dotnet build | |
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" |