Write unused references to a log file (#94) #85
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: Build and Test - CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "v*" | |
# Allow manually triggering | |
workflow_dispatch: | |
jobs: | |
build: | |
# TODO: Add ubuntu-latest | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Git Versioning requires a non-shallow clone | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
- name: Run vcvarsall.bat on Windows for MSVC testing | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Restore | |
run: dotnet restore -bl:logs/restore.binlog | |
- name: Build | |
run: dotnet build --configuration Release --no-restore -bl:logs/build.binlog | |
- name: Test | |
run: dotnet test --configuration Release --no-build --logger trx --results-directory TestResults --collect:"Code Coverage;Format=Cobertura" | |
# - name: Upload coverage to Codecov | |
# uses: codecov/codecov-action@v4 | |
# with: | |
# directory: ./TestResults | |
# files: "*.cobertura.xml" | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results | |
path: ./TestResults | |
if: ${{ always() }} # Always run this step even on failure | |
- name: Upload logs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: logs | |
path: ./logs | |
if: ${{ always() }} # Always run this step even on failure | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts | |
path: ./artifacts | |
if: ${{ always() }} # Always run this step even on failure | |
- name: Push NuGet package | |
run: dotnet nuget push artifacts\*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate | |
if: startsWith(github.ref, 'refs/tags/v') |