chore: Migrate from StyleCop and Code Analysis rulesets to C# Analyzers and editorconfig #21
Workflow file for this run
This file contains 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: .NET | |
on: | |
push: | |
branches: | |
- main | |
- next | |
- beta | |
- dev | |
- "*.x" | |
pull_request: | |
branches: | |
- main | |
- next | |
- beta | |
- dev | |
- "*.x" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
global-json-file: global.json | |
- name: Restore tools | |
run: dotnet tool restore | |
- name: Restore dependencies | |
run: dotnet restore --locked-mode | |
- name: Build | |
run: dotnet build --no-restore | |
- name: Test | |
run: dotnet test --no-build --verbosity normal -p:TestingPlatformCommandLineArguments="--report-trx --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml" | |
- name: Convert test results | |
if: ${{ !cancelled() }} | |
run: | | |
find . -name "*.trx" -exec dotnet tool run trx2junit --output TestResults/JUnit {} + | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
slug: hangy/AntiXss | |
- name: Upload test results to Codecov | |
if: ${{ !cancelled() }} | |
uses: codecov/test-results-action@v1 | |
with: | |
files: TestResults/JUnit/*.xml | |
token: ${{ secrets.CODECOV_TOKEN }} |