fix: connector doesn't recover from failure after network issue #1938
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: Build and Test | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| jobs: | |
| build-matrix: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4 | |
| with: | |
| dotnet-version: 10 | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore | |
| - name: Format | |
| run: dotnet format --verify-no-changes --severity=error | |
| - name: Test | |
| run: dotnet test --no-restore --verbosity normal /p:Exclude="[*.Test]*" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=TestResults/ ./Cognite.Simulator.Tests/ --logger:"console" | |
| env: | |
| COGNITE_PROJECT: ${{ secrets.COGNITE_PROJECT }} | |
| COGNITE_HOST: ${{ secrets.COGNITE_HOST }} | |
| AZURE_TENANT: ${{ secrets.AZURE_TENANT }} | |
| AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
| AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | |
| - name: Upload coverage to artifacts | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: coverage-${{ matrix.os }} | |
| path: ./Cognite.Simulator.Tests/TestResults/coverage.opencover.xml | |
| retention-days: 1 | |
| build: | |
| needs: build-matrix | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Report build status | |
| run: echo "All matrix builds completed successfully" | |
| upload-coverage: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - name: Download Ubuntu coverage | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | |
| with: | |
| name: coverage-ubuntu-latest | |
| path: ./coverage-ubuntu | |
| - name: Download Windows coverage | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | |
| with: | |
| name: coverage-windows-latest | |
| path: ./coverage-windows | |
| - name: Upload combined coverage to Codecov | |
| uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage-ubuntu/coverage.opencover.xml,./coverage-windows/coverage.opencover.xml | |
| fail_ci_if_error: true |