75 lines
1.7 KiB
YAML
75 lines
1.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build-backend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: '8.0.x'
|
|
|
|
- name: Restore dependencies
|
|
run: dotnet restore FictionArchive.sln
|
|
|
|
- name: Build solution
|
|
run: dotnet build FictionArchive.sln --configuration Release --no-restore /p:SkipFusionBuild=true
|
|
|
|
- name: Run tests
|
|
run: |
|
|
dotnet test FictionArchive.sln --configuration Release --no-build --verbosity normal \
|
|
--logger "trx;LogFileName=test-results.trx" \
|
|
--collect:"XPlat Code Coverage" \
|
|
--results-directory ./TestResults
|
|
|
|
- name: Upload test results
|
|
uses: christopherhx/gitea-upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: test-results
|
|
path: ./TestResults/**/*.trx
|
|
retention-days: 30
|
|
|
|
- name: Upload coverage results
|
|
uses: christopherhx/gitea-upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: coverage-results
|
|
path: ./TestResults/**/coverage.cobertura.xml
|
|
retention-days: 30
|
|
|
|
build-frontend:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: fictionarchive-web
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6.0.0
|
|
with:
|
|
node-version: '20'
|
|
package-manager-cache: false
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Lint
|
|
run: npm run lint
|
|
|
|
- name: Build
|
|
run: npm run build
|