Merge pull request #17 from labelzoom/dependabot/nuget/src/xunit-2.9.1 #96
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
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: .NET Build | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: [self-hosted, linux] | |
env: | |
DOTNET_INSTALL_DIR: "./.dotnet" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore dependencies | |
working-directory: ./src | |
run: ../.dotnet/dotnet restore | |
- name: Build | |
working-directory: ./src | |
run: ../.dotnet/dotnet build --no-restore | |
- name: Test | |
working-directory: ./src | |
run: ../.dotnet/dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" --logger:trx | |
env: | |
MOCA_URL: ${{ vars.MOCA_URL }} | |
MOCA_HOST: ${{ vars.MOCA_HOST }} | |
MOCA_PORT: ${{ vars.MOCA_PORT }} | |
MOCA_USER: ${{ vars.MOCA_USER }} | |
MOCA_PASS: ${{ vars.MOCA_PASS }} | |
- uses: actions/upload-artifact@v4 # upload test results | |
if: success() || failure() # run this step even if previous step failed | |
with: | |
name: test-results | |
path: "**/TestResults/*.trx" | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
slug: labelzoom/labelzoom-moca-client-dotnet |