Skip to content

refactor: apply dependency injection pattern across command and query… #18

refactor: apply dependency injection pattern across command and query…

refactor: apply dependency injection pattern across command and query… #18

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
env:
DOTNET_VERSION: '9.0.x'
NODE_VERSION: '20.x'
PNPM_VERSION: '10'
jobs:
dotnet:
name: .NET Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Test
run: dotnet test --no-build --configuration Release --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage --settings ./coverlet.runsettings
- name: Upload coverage reports
uses: actions/upload-artifact@v4
if: always()
with:
name: dotnet-coverage
path: ./coverage
retention-days: 7
frontend:
name: Frontend Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: ${{ env.PNPM_VERSION }}
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm nx run-many --target=lint --all
- name: Build
run: pnpm nx run-many --target=build --all
- name: Test
run: pnpm nx run-many --target=test --all --coverage
- name: Upload frontend coverage
uses: actions/upload-artifact@v4
if: always()
with:
name: frontend-coverage
path: coverage/
retention-days: 7
check-all:
name: All Checks Passed
needs: [dotnet, frontend]
runs-on: ubuntu-latest
steps:
- run: echo "All checks passed!"