Skip to content

Bump Microsoft.ApplicationInsights.AspNetCore from 3.0.0 to 3.1.0 #536

Bump Microsoft.ApplicationInsights.AspNetCore from 3.0.0 to 3.1.0

Bump Microsoft.ApplicationInsights.AspNetCore from 3.0.0 to 3.1.0 #536

Workflow file for this run

name: test
on:
push:
branches:
- main
paths:
- "src/**/*.cs"
- "tests/UnitTests/**/*.cs"
- "tests/IntegrationTests/**/*.cs"
- "**/*.csproj"
- "**/*.props"
pull_request:
branches:
- main
paths:
- "**/*.cs"
- "**/*.csproj"
- "**/*.props"
- "**/packages.lock.json"
- "docker-compose.yml"
- "tests/Dockerfile"
- ".config/dotnet-tools.json"
- "global.json"
- ".github/workflows/test.yml"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
playwright-image:
runs-on: ubuntu-latest
outputs:
base-image: ${{ steps.get-base-image.outputs.base-image }}
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Get base image
id: get-base-image
run: |
IMAGE=$(sed -n 's/^FROM[[:space:]]\+\(.*\)/\1/p' tests/Dockerfile | head -n 1)
echo "base-image=$IMAGE" >> $GITHUB_OUTPUT
unit-test:
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
matrix:
os: ["ubuntu-latest"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup .NET
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
global-json-file: ./global.json
cache: true
cache-dependency-path: "**/packages.lock.json"
- name: Restore
run: dotnet restore --locked-mode
- name: Test & collect coverage
run: |
dotnet test --project tests/UnitTests -c Release --no-restore \
--results-directory ${{ runner.temp }}/test-results/unit \
--coverage --coverage-output-format cobertura --coverage-output coverage-unit.cobertura.xml
- name: Upload coverage report
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: coverage-report-unit
path: ${{ runner.temp }}/test-results/unit
overwrite: true
retention-days: 1
integration-test:
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
matrix:
os: ["ubuntu-latest"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup .NET
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
global-json-file: ./global.json
cache: true
cache-dependency-path: "**/packages.lock.json"
- name: Restore
run: dotnet restore --locked-mode
- name: Test
run: |
dotnet test --project tests/IntegrationTests -c Release --no-restore \
--results-directory ${{ runner.temp }}/test-results/integration \
--coverage --coverage-output-format cobertura --coverage-output coverage-integration.cobertura.xml
env:
SHOW_MOCK_SERVER_LOGS: ${{ vars.SHOW_MOCK_SERVER_LOGS }}
TESTING_LOG_LEVEL: ${{ vars.TESTING_LOG_LEVEL }}
- name: Upload coverage report
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: coverage-report-integration
path: ${{ runner.temp }}/test-results/integration
overwrite: true
retention-days: 1
architecture-test:
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
matrix:
os: ["ubuntu-latest"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup .NET
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
global-json-file: ./global.json
cache: true
cache-dependency-path: "**/packages.lock.json"
- name: Restore
run: dotnet restore --locked-mode
- name: Test
run: dotnet test --project tests/ArchitectureTests -c Release --no-restore
e2e-test:
runs-on: ${{ matrix.os }}
needs: playwright-image
permissions:
contents: write
container:
image: ${{ needs.playwright-image.outputs.base-image }}
options: --init --ipc=host
strategy:
matrix:
os: ["ubuntu-latest"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup .NET
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
global-json-file: ./global.json
cache: true
cache-dependency-path: "**/packages.lock.json"
- name: Restore
run: dotnet restore --locked-mode
- name: Test
run: dotnet test --project tests/E2ETests -c Release --no-restore
coverage:
runs-on: ubuntu-latest
needs: [unit-test, integration-test]
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup .NET
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
global-json-file: ./global.json
- name: Install Report Generator
run: dotnet tool restore
- name: Download all coverage artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: ${{ runner.temp }}/coverage-reports
- name: Generate report
run: |
dotnet tool run reportgenerator -reports:"${{ runner.temp }}/coverage-reports/**/*cobertura.xml" \
-targetdir:"${{ runner.temp }}/coverage-report" \
-reporttypes:"Badges;MarkdownSummaryGithub"
- name: Create coverage-reports branch and push content
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
run: |
git fetch origin coverage-reports
git checkout coverage-reports || git checkout -b coverage-reports
cp -rp ${{ runner.temp }}/coverage-report/badge_combined.svg ./
git config user.name github-actions
git config user.email github-actions@github.com
git add badge_combined.svg
git commit -m "Update coverage reports" || echo "No changes to commit"
git push origin coverage-reports
- name: Set coverage summary
run: cat ${{ runner.temp }}/coverage-report/SummaryGithub.md >> $GITHUB_STEP_SUMMARY