Skip to content

CI

CI #116

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
jobs:
build:
runs-on: ubuntu-latest
env:
solution-path: ./src/HassClient.sln
test-results-path: ./test-results
build-config: Release
strategy:
matrix:
channel:
- stable
steps:
- uses: actions/checkout@v2
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1.7.2
with:
dotnet-version: 6.0.x
- name: Install trx2junit
run: |
export PATH="$PATH:/root/.dotnet/tools"
dotnet tool install --global trx2junit --version 2.0.0
- name: Restore dependencies
run: dotnet restore ${{env.solution-path}}
- name: Build
run: dotnet build --no-restore --configuration ${{env.build-config}} ${{env.solution-path}}
- name: Test
run: dotnet test --no-build --configuration ${{env.build-config}} --logger "trx" ${{env.solution-path}}
- name: Convert to JUnit format
if: always()
run: |
mkdir ${{env.test-results-path}}
find ./src/ -print \
| grep -i 'TestResults/.*[.]trx' \
| while read filename; \
do cp $filename "${{env.test-results-path}}/$(basename $(dirname $(dirname $filename))).trx"; \
done
trx2junit ${{env.test-results-path}}/*.trx
- name: Publish Unit Test Results
if: always()
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: ${{env.test-results-path}}/*.xml