cicd-github-actions/.github/workflows/build-and-test.yml
2023-07-10 12:14:05 +01:00

38 lines
No EOL
1.1 KiB
YAML

name: Build and Test
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build
- name: Run Unit Tests
run: dotnet test --filter Category=Unit --no-restore --verbosity normal
- uses: canastro/copy-file-action@master
with:
source: "test/**/TestResults/Unit.Tests.trx"
target: "TestResults"
- name: Start containers
run: docker-compose -f "docker-compose.yml" up -d --build
- name: Wait for docker containers to setup
run: sleep 30s
shell: bash
- name: Run Integration Tests
run: dotnet test --filter Category=Integration --no-restore --verbosity normal
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Test Results
path: TestResults/*.trx
reporter: dotnet-trx