diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..12fe997 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + workflow_dispatch: + +env: + DOTNET_NOLOGO: true + DOTNET_CLI_TELEMETRY_OPTOUT: true + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + +jobs: + build-test: + name: Build & Test + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + + - name: Restore + run: dotnet restore CSharp_RomValidator.sln + + - name: Build + run: dotnet build CSharp_RomValidator.sln --configuration Release --no-restore + + - name: Test + run: dotnet test CSharp_RomValidator.sln --configuration Release --no-build --logger "trx;LogFileName=test-results.trx" --collect:"XPlat Code Coverage" --results-directory TestResults + + - name: Upload test results + if: always() + uses: actions/upload-artifact@v4 + with: + name: test-results + path: TestResults/**/*.trx + if-no-files-found: ignore + + - name: Upload code coverage + if: always() + uses: actions/upload-artifact@v4 + with: + name: code-coverage + path: TestResults/**/coverage.cobertura.xml + if-no-files-found: ignore diff --git a/.gitignore b/.gitignore index 3701580..8b42c80 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ bin/ obj/ +TestResults/ /packages/ riderModule.iml *.sln.DotSettings.user