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
70 changes: 38 additions & 32 deletions .github/workflows/codecoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,52 @@ name: Code Coverage

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- main
workflow_dispatch:

jobs:
permissions:
contents: read

jobs:
build:
name: "Code Coverage"
name: Code Coverage
env:
ASPNETCORE_ENVIRONMENT: "Production"
ASPNETCORE_ENVIRONMENT: Production

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2.3.4

- name: Restore Nuget Packages
run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}

- name: Build Code
run: dotnet build FileProcessor.sln --configuration Release

- name: Run Unit Tests
run: |
echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
dotnet test "FileProcessor.BusinessLogic.Tests\FileProcessor.BusinessLogic.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov1.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov"
dotnet test "FileProcessor.FileAggregate.Tests\FileProcessor.FileAggregate.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov2.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov"
dotnet test "FileProcessor.FileImportLogAggregate.Tests\FileProcessor.FileImportLogAggregate.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov3.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov"

- name: Install LCOV merger
run: npm install -g lcov-result-merger

- name: Merge LCOV reports
run: |
mkdir -p coverage
lcov-result-merger "*.info" > lcov.info

- name: Upload merged coverage to Codacy
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./lcov.info
- uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Restore Nuget Packages
run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}

- name: Build Code
run: dotnet build FileProcessor.sln --configuration Release --no-restore

- name: Run Unit Tests
run: |
echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
dotnet run --project "FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj" --configuration Release --no-build -- --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml --results-directory "./coverage/businesslogic"
dotnet run --project "FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj" --configuration Release --no-build -- --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml --results-directory "./coverage/fileaggregate"
dotnet run --project "FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj" --configuration Release --no-build -- --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml --results-directory "./coverage/fileimportlogaggregate"

- name: Merge Coverage Reports
uses: danielpalme/ReportGenerator-GitHub-Action@v5
with:
reports: ./coverage/**/*.cobertura.xml
targetdir: ./coverage-report
reporttypes: Cobertura

- name: Upload coverage to Codacy
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./coverage-report/Cobertura.xml

81 changes: 43 additions & 38 deletions .github/workflows/nightlybuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,54 +12,59 @@ permissions:

jobs:
build:
name: "Nightly Build"
name: Nightly Build
env:
ASPNETCORE_ENVIRONMENT: "Production"
ASPNETCORE_ENVIRONMENT: Production

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Set Up Variables
run: echo "action_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV
- name: Set Up Variables
run: echo "action_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV

- name: Restore Nuget Packages
run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
- name: Restore Nuget Packages
run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}

- name: Build Code
run: dotnet build FileProcessor.sln --configuration Release
- name: Build Code
run: dotnet build FileProcessor.sln --configuration Release --no-restore

- name: Run Unit Tests
run: |
echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
dotnet test "FileProcessor.BusinessLogic.Tests\FileProcessor.BusinessLogic.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov1.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov"
dotnet test "FileProcessor.FileAggregate.Tests\FileProcessor.FileAggregate.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov2.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov"
dotnet test "FileProcessor.FileImportLogAggregate.Tests\FileProcessor.FileImportLogAggregate.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov3.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov"
- name: Run Unit Tests
run: |
echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
dotnet test "FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj" --configuration Release --no-build
dotnet test "FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj" --configuration Release --no-build
dotnet test "FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj" --configuration Release --no-build

- name: Build Docker Image
run: docker build . --file FileProcessor/Dockerfile --tag fileprocessor:latest

- name: Run Integration Tests
run: dotnet test "FileProcessor.IntegrationTests\FileProcessor.IntegrationTests.csproj"
- name: Build Docker Image
run: docker build . --file FileProcessor/Dockerfile --tag fileprocessor:latest
- name: Run Integration Tests
run: dotnet test "FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj" --configuration Release --no-build

- uses: actions/upload-artifact@v4.4.0
with:
name: tracelogs
path: /home/runner/trace/
- uses: actions/upload-artifact@v4.4.0
with:
name: tracelogs
path: /home/runner/trace/


- name: Notify on nightly failure
if: ${{ failure() }}
uses: TransactionProcessing/org-ci-workflows/.github/actions/nightly-failure-issue@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
title: Investigate Nightly Build Failure
labels: nightlybuild
dedupe_key: nightlybuild
body: |
Repo: ${{ github.repository }}
Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
Commit: ${{ github.sha }}
Workflow: ${{ github.workflow }}
Job: ${{ github.job }}
- name: Notify on nightly failure
if: ${{ failure() }}
uses: TransactionProcessing/org-ci-workflows/.github/actions/nightly-failure-issue@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
title: Investigate Nightly Build Failure
labels: nightlybuild
dedupe_key: nightlybuild
body: |
Repo: ${{ github.repository }}
Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
Commit: ${{ github.sha }}
Workflow: ${{ github.workflow }}
Job: ${{ github.job }}
93 changes: 49 additions & 44 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,62 @@

jobs:
build:
name: "Build and Test Pull Requests"
name: Build and Test Pull Requests
env:
ASPNETCORE_ENVIRONMENT: "Production"
ASPNETCORE_ENVIRONMENT: Production

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2.3.4

- name: Echo vars
run: |
echo "CI is > ${CI}"
echo "HOME is > ${HOME}"

- name: Restore Nuget Packages
run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}

- name: Build Code
run: dotnet build FileProcessor.sln --configuration Release

- name: Run Unit Tests
run: |
echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
dotnet test "FileProcessor.BusinessLogic.Tests\FileProcessor.BusinessLogic.Tests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=businesslogic-test-results.trx"
dotnet test "FileProcessor.FileAggregate.Tests\FileProcessor.FileAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=fileaggregate-test-results.trx"
dotnet test "FileProcessor.FileImportLogAggregate.Tests\FileProcessor.FileImportLogAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=fileimportlogaggregate-test-results.trx"

- name: Build Docker Image
run: docker build . --file FileProcessor/Dockerfile --tag fileprocessor:latest

- name: Run Integration Tests
run: dotnet test "FileProcessor.IntegrationTests\FileProcessor.IntegrationTests.csproj" --filter Category=PRTest --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=integration-test-results.trx"

- uses: actions/upload-artifact@v4.4.0
with:
name: tracelogs
path: /home/runner/trace/

- name: Publish test results
uses: dorny/test-reporter@v1
if: always()
with:
- uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Echo vars
run: |
echo "CI is > ${CI}"
echo "HOME is > ${HOME}"

- name: Restore Nuget Packages
run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}

- name: Build Code
run: dotnet build FileProcessor.sln --configuration Release --no-restore

- name: Run Unit Tests
run: |
echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
dotnet test "FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx --report-xunit-trx-filename businesslogic-test-results.trx
dotnet test "FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx --report-xunit-trx-filename fileaggregate-test-results.trx
dotnet test "FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx --report-xunit-trx-filename fileimportlogaggregate-test-results.trx

- name: Build Docker Image
run: docker build . --file FileProcessor/Dockerfile --tag fileprocessor:latest

- name: Run Integration Tests
run: dotnet test "FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj" --configuration Release --no-build --verbosity normal -- --filter "Category=PRTest"

- uses: actions/upload-artifact@v4.4.0
with:
name: tracelogs
path: /home/runner/trace/

- name: Publish test results
uses: dorny/test-reporter@v1
if: always()
with:
name: Unit Test Results
path: '**/TestResults/*.trx'
reporter: dotnet-trx
fail-on-error: true
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: '**/TestResults/*.trx'
retention-days: 30
path: '**/TestResults/*'
retention-days: 30
Comment on lines +10 to +67
Loading
Loading