Skip to content

run-tests

run-tests #93

Workflow file for this run

---
name: run-tests
on:
workflow_dispatch:
jobs:
tests:
name: Run backend tests
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:12-alpine
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: omnikeeper_tests
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 10
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup .NET 7.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x'
- name: Run tests
env:
ConnectionStrings__DatabaseConnection: Server=localhost;Port=5432;User Id=postgres;Password=postgres;Database=omnikeeper_tests;Pooling=false
run: |
cd backend
cd Tests
dotnet test -c Release /p:CollectCoverage=true /p:CoverletOutput=coverage /p:CoverletOutputFormat=opencover # -- StopOnError=true
- name: Upload coverage reports to Codecov
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${CODECOV_TOKEN}