Skip to content

Bugfix/simple method with parameter (#83) #196

Bugfix/simple method with parameter (#83)

Bugfix/simple method with parameter (#83) #196

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Restore dependencies
run: dotnet restore EasySourceGenerators.sln
- name: Test
run: dotnet test EasySourceGenerators.sln --no-restore --verbosity normal --collect:"XPlat Code Coverage" --logger "trx;LogFilePrefix=test-results" --results-directory ./coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
directory: ./coverage
use_oidc: true
fail_ci_if_error: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
- name: Convert TRX to JUnit XML
if: ${{ !cancelled() }}
run: |
if dotnet tool list --global | grep -q '^trx2junit '; then
dotnet tool update --global trx2junit --version 2.1.0
else
dotnet tool install --global trx2junit --version 2.1.0
fi
TRX_FILES="$(find ./coverage -type f -name '*.trx')"
if [ -n "$TRX_FILES" ]; then
trx2junit $TRX_FILES
else
echo "No TRX files found in ./coverage."
fi
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/*.xml
disable_search: true