Nightly Build #671
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: "45 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 EstateReportingAPI.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} | |
| - name: Build Code | |
| run: dotnet build EstateReportingAPI.sln --configuration Release | |
| - name: Run Unit Tests | |
| run: | | |
| echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}" | |
| dotnet test "EstateReportingAPI.Tests\EstateReportingAPI.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" | |
| - name: Build Docker Image | |
| run: docker build . --file EstateReportingAPI/Dockerfile --tag estatereportingapi:latest | |
| - name: Run Integration Tests | |
| run: | | |
| dotnet test "EstateReportingAPI.IntegrationTests\EstateReportingAPI.IntegrationTests.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 | |
| files: ./lcov2.info | |
| - uses: actions/[email protected] | |
| if: ${{ failure() }} | |
| with: | |
| name: tracelogs | |
| path: /home/txnproc/trace/ | |
| - 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}} |