Kyoo/.github/workflows/tests.yml
2021-06-27 22:19:31 +02:00

35 lines
965 B
YAML

name: Testing
on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-latest
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'
- name: Test
run: dotnet test --no-build '-p:CollectCoverage=true;CoverletOutputFormat=opencover'
env:
POSTGRES_HOST: postgres
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: postgres
- name: Upload coverage report
uses: actions/upload-artifact@v2
with:
name: coverage.xml
path: "Kyoo.Tests/coverage.opencover.xml"