Skip to content

Adding unit test.

Adding unit test. #182

Workflow file for this run

name: CI
on: [ push, pull_request ]
env:
VERSION: 2.0.0
jobs:
build:
runs-on: windows-latest
timeout-minutes: 15
strategy:
matrix:
node: [win10,win11]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Decrypt SNK file
run: ./.github/scripts/decrypt_snk.bat
env:
snk_passphrase: ${{ secrets.SNK_PASSPHRASE }}
- uses: benjlevesque/short-sha@v3.0
id: short-sha
- name: Run build
run: dotnet build --configuration Release /p:HostIdentifier="${{ env.HOST_IDENTIFIER }}" /p:Version="${{ env.VERSION }}" /p:PackageVersion="${{ env.VERSION }}${{ env.VERSION_SUFFIX }}"
env:
VERSION_SUFFIX: -preview.${{ github.run_number }}
HOST_IDENTIFIER: ${{ matrix.node }}
- name: Run test
run: dotnet test --configuration Release --no-build /p:HostIdentifier="${{ env.HOST_IDENTIFIER }}" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
env:
HOST_IDENTIFIER: ${{ matrix.node }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.node }}-packages
path: |
**/*.nupkg
publish:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Publish to GitHub
run: dotnet nuget push **/*.nupkg -k ${NUGET_TOKEN} -s ${PUBLISH_URL} --skip-duplicate --no-symbols
env:
NUGET_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_URL: https://nuget.pkg.github.com/dotras/index.json