mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-12-27 07:10:25 -05:00
49 lines
1.6 KiB
YAML
49 lines
1.6 KiB
YAML
name: Testing
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
|
container: mcr.microsoft.com/dotnet/sdk:5.0
|
|
services:
|
|
postgres:
|
|
image: postgres
|
|
env:
|
|
POSTGRES_PASSWORD: postgres
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Restore dependencies
|
|
run: dotnet restore
|
|
- name: Build
|
|
run: |
|
|
dotnet build --no-restore '-p:SkipWebApp=true;SkipTranscoder=true' -p:CopyLocalLockFileAssemblies=true
|
|
cp ./src/Kyoo.Abstractions/bin/Debug/net5.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll ./tests/Kyoo.Tests/bin/Debug/net5.0/
|
|
- name: Test
|
|
run: dotnet test --no-build '-p:CollectCoverage=true;CoverletOutputFormat=opencover' --logger "trx;LogFileName=TestOutputResults.xml"
|
|
env:
|
|
POSTGRES_HOST: postgres
|
|
POSTGRES_USERNAME: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
- name: Sanitize coverage output
|
|
if: ${{ always() }}
|
|
run: sed -i "s'$(pwd)'.'" tests/Kyoo.Tests/coverage.opencover.xml
|
|
- name: Upload tests results
|
|
if: ${{ always() }}
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: results.xml
|
|
path: "**/TestOutputResults.xml"
|
|
- name: Upload coverage report
|
|
if: ${{ always() }}
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: coverage.xml
|
|
path: "**/coverage.opencover.xml"
|