Add unit tests to CI

This commit is contained in:
Laura Hausmann 2024-01-20 20:40:45 +01:00
parent 9d70c68dbd
commit 42613d0a94
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
2 changed files with 21 additions and 0 deletions

View file

@ -3,6 +3,23 @@ on:
branches: branches:
- 'dev' - 'dev'
jobs: jobs:
unit-tests:
runs-on: docker
container:
image: mcr.microsoft.com/dotnet/sdk:8.0-alpine
steps:
- name: Clone repository
run: git clone https://iceshrimp.dev/iceshrimp/iceshrimp-rewrite.git --branch=${{ github.ref_name }} --depth=1 /iceshrimp
- name: Build the backend
run: |
cd /iceshrimp/Iceshrimp.Backend
dotnet restore
mkdir -p ./wwwroot/.vite/ && touch ./wwwroot/.vite/manifest.json
dotnet build
- name: Test the backend
run: |
cd /iceshrimp/Iceshrimp.Tests
dotnet test
build-and-push: build-and-push:
runs-on: docker runs-on: docker
container: container:

View file

@ -28,3 +28,7 @@ jobs:
dotnet restore dotnet restore
mkdir -p ./wwwroot/.vite/ && touch ./wwwroot/.vite/manifest.json mkdir -p ./wwwroot/.vite/ && touch ./wwwroot/.vite/manifest.json
dotnet build dotnet build
- name: Test the backend
run: |
cd /iceshrimp/Iceshrimp.Tests
dotnet test