Nightly Build #2190
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
| name: Nightly Build | |
| on: | |
| schedule: | |
| - cron: "20 23 * * *" | |
| repository_dispatch: | |
| jobs: | |
| build: | |
| name: "Nightly Build" | |
| env: | |
| ASPNETCORE_ENVIRONMENT: "Production" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/[email protected] | |
| - name: Install NET 9 | |
| uses: actions/[email protected] | |
| with: | |
| dotnet-version: '9.0.x' | |
| - 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 TransactionProcessorACL.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} | |
| - name: Build Code | |
| run: dotnet build TransactionProcessorACL.sln --configuration Release | |
| - name: Run Unit Tests | |
| run: | | |
| echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}" | |
| dotnet test "TransactionProcessorACL.Tests\TransactionProcessorACL.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 "TransactionProcessorACL.BusinessLogic.Tests\TransactionProcessorACL.BusinessLogic.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" | |
| - 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 | |
| - name: Build Docker Image | |
| run: docker build . --file TransactionProcessorACL/Dockerfile --tag transactionprocessoracl:latest | |
| - name: Run Integration Tests | |
| run: dotnet test "TransactionProcessorACL.IntegrationTests\TransactionProcessorACL.IntegrationTests.csproj" | |
| - uses: dacbd/create-issue-action@main | |
| if: ${{ failure() }} | |
| name: Create an issue on build failure | |
| with: | |
| title: Investigate Nightly Build Failure | |
| token: ${{secrets.GITHUB_TOKEN}} | |
| labels: nightlybuild | |
| body: Url is ${{env.action_url}} |