This directory contains GitHub Actions workflows for automated testing, building, and deployment of the TaskAgent application.
| Workflow | File | Target | Tests | Deployment |
|---|---|---|---|---|
| Backend | backend.yml |
.NET 10 Web API | 132 (Unit + Integration) | Azure App Service |
| Frontend | frontend.yml |
Next.js 16 | 94 (Unit + E2E) | Azure Static Web Apps |
Total Tests: 226 tests executed on every push/PR
File: backend.yml
-
Push to
mainwhen these paths change:.github/workflows/backend.ymlsrc/Directory.Build.propssrc/Directory.Packages.propssrc/global.jsonsrc/backend/services/TaskAgent/src/**/*.cssrc/backend/services/TaskAgent/src/**/*.csprojsrc/backend/services/TaskAgent/src/**/*.jsonsrc/backend/services/TaskAgent/tests/**/*.cssrc/backend/services/TaskAgent/tests/**/*.csprojsrc/backend/TaskAgent.ServiceDefaults/**src/backend/TaskAgentWeb.sln
-
Pull Request to
mainwhen these paths change:src/backend/**(except.mdfiles)
graph LR
A[test] --> B[build] --> C[deploy]
style A fill:#4CAF50
style B fill:#FF9800
style C fill:#2196F3
| Step | Description | Timeout |
|---|---|---|
| Checkout | Clone repository | - |
| Setup .NET | Install .NET 10.0.x SDK | - |
| Restore | Restore solution NuGet packages | - |
| Build | Build solution in Release | - |
| Unit Tests (Domain) | TaskAgent.Domain.UnitTests (28 tests) |
- |
| Unit Tests (Application) | TaskAgent.Application.UnitTests (75 tests) |
- |
| Integration Tests | TaskAgent.Infrastructure.IntegrationTests (29 tests) |
- |
| Generate Coverage Report | Combine coverage with ReportGenerator | - |
| Generate Summary | Test counts + coverage in Job Summary | - |
| Upload Test Results | backend-test-results artifact (TRX) |
30 days |
| Upload Coverage | backend-coverage artifact (HTML) |
30 days |
Total Tests: 132 (103 unit + 29 integration with Testcontainers)
| Step | Description |
|---|---|
| Checkout | Clone repository |
| Setup .NET | Install .NET 10.0.x SDK |
| Restore | Restore NuGet packages |
| Build | Build in Release configuration |
| Publish | Create deployment package |
| Upload Artifact | Save webapp artifact |
| Step | Description |
|---|---|
| Download Artifact | Retrieve build output |
| Azure Login | Authenticate with Service Principal |
| Deploy | Push to Azure App Service |
The workflow provides rich test visualization directly in GitHub:
| Project | Tests | Status |
|---|---|---|
| Domain.UnitTests | 28/28 | ✅ |
| Application.UnitTests | 75/75 | ✅ |
| Infrastructure.IntegrationTests | 29/29 | ✅ |
| Metric | Coverage |
|---|---|
| Lines | 75.5% |
| Branches | 62.3% |
| Methods | 80.1% |
📥 Download Reports:
backend-test-results- TRX test resultsbackend-coverage- HTML coverage report
| Variable | Value | Description |
|---|---|---|
AZURE_WEBAPP_NAME |
app-taskagent-prod |
Azure App Service name |
DOTNET_CORE_VERSION |
10.0.x |
.NET SDK version |
CONFIGURATION |
Release |
Build configuration |
SOLUTION_PATH |
src/backend/TaskAgentWeb.sln |
Solution file path |
TESTS_DIRECTORY |
src/backend/services/TaskAgent/tests |
Test projects path |
| Artifact | Content | Retention |
|---|---|---|
backend-test-results |
TRX test result files | 30 days |
backend-coverage |
Combined HTML coverage report | 30 days |
webapp |
Published .NET app | Default |
| Secret | Description |
|---|---|
app_taskagent_prod_SPN |
Azure Service Principal credentials (JSON) |
File: frontend.yml
-
Push to
mainwhen these paths change:.github/workflows/frontend.ymlsrc/frontend/task-agent-web/**(except.mdfiles)
-
Pull Request to
mainwhen these paths change:src/frontend/task-agent-web/**(except.mdfiles)
graph LR
A[test] --> B[build_and_deploy]
style A fill:#4CAF50
style B fill:#2196F3
| Step | Description | Timeout |
|---|---|---|
| Checkout | Clone repository | - |
| Setup pnpm | Install pnpm v9 | - |
| Setup Node.js | Install Node.js 20 + cache | - |
| Install dependencies | pnpm install --frozen-lockfile |
- |
| Unit Tests | pnpm test:coverage (57 tests) |
- |
| Generate Summary | Coverage table in Job Summary | - |
| Upload Coverage | unit-test-coverage artifact |
30 days |
| Install Playwright | Chromium browser + dependencies | - |
| E2E Tests | pnpm test:e2e (37 tests) |
- |
| Generate Summary | E2E results in Job Summary | - |
| Upload Report | playwright-report artifact |
30 days |
| Upload Failures | playwright-test-results (on failure) |
7 days |
Total Tests: 94 (57 unit + 37 E2E)
| Step | Description |
|---|---|
| Checkout | Clone repository with submodules |
| Setup pnpm | Install pnpm v9 |
| Setup Node.js | Install Node.js 20 + cache |
| Install dependencies | pnpm install --frozen-lockfile |
| Build | pnpm build with environment variables |
| Deploy | Push to Azure Static Web Apps |
The workflow provides rich test visualization directly in GitHub:
| Metric | Coverage |
|---|---|
| Lines | 85.2% |
| Statements | 84.1% |
| Functions | 78.5% |
| Branches | 72.3% |
✅ E2E tests completed. See artifacts for detailed HTML report.
📥 Download Reports:
playwright-report- Interactive HTML reportunit-test-coverage- Coverage HTML report
When E2E tests fail, Playwright's github reporter creates annotations directly in the code:
| Secret | Description |
|---|---|
AZURE_STATIC_WEB_APPS_API_TOKEN |
Azure Static Web Apps deployment token |
NEXT_PUBLIC_API_URL |
Backend API URL for production |
| Artifact | Content | Retention |
|---|---|---|
unit-test-coverage |
HTML coverage report, lcov, JSON | 30 days |
playwright-report |
Interactive HTML E2E report | 30 days |
playwright-test-results |
Screenshots/videos (on failure) | 7 days |
-
Create Azure Service Principal:
az ad sp create-for-rbac \ --name "github-actions-taskagent" \ --role contributor \ --scopes /subscriptions/{subscription-id}/resourceGroups/{resource-group} \ --sdk-auth -
Add to GitHub Secrets:
- Go to Repository → Settings → Secrets → Actions
- Add
app_taskagent_prod_SPNwith the JSON output
-
Get Azure Static Web Apps Token:
- Azure Portal → Static Web Apps → Your App → Manage deployment token
-
Add to GitHub Secrets:
AZURE_STATIC_WEB_APPS_API_TOKEN: Deployment tokenNEXT_PUBLIC_API_URL: Production API URL (e.g.,https://api.taskagent.com)
┌─────────────────────────────────────────────────────────────┐
│ Push to main │
└─────────────────────────────────────────────────────────────┘
│
┌───────────────────┴───────────────────┐
▼ ▼
┌─────────────────────┐ ┌─────────────────────┐
│ backend.yml │ │ frontend.yml │
│ │ │ │
│ ┌─────────┐ │ │ ┌─────────┐ │
│ │ test │ │ │ │ test │ │
│ │ 132 tests│ │ │ │ 94 tests│ │
│ └────┬────┘ │ │ └────┬────┘ │
│ │ │ │ │ │
│ ▼ │ │ ▼ │
│ ┌─────────┐ │ │ ┌─────────┐ │
│ │ build │ │ │ │ build & │ │
│ └────┬────┘ │ │ │ deploy │ │
│ │ │ │ └─────────┘ │
│ ▼ │ │ │
│ ┌─────────┐ │ │ Azure Static Web │
│ │ deploy │ │ └─────────────────────┘
│ └─────────┘ │
│ │
│ Azure App Service │
└─────────────────────┘
Total Tests: 226 (132 backend + 94 frontend)
Both workflows can be triggered manually via GitHub UI:
- Go to Actions tab
- Select the workflow
- Click Run workflow
- Select branch and run
To skip CI for a commit, add [skip ci] to the commit message:
git commit -m "docs: update README [skip ci]"For frontend, create a Pull Request instead of pushing directly to main. The test job will run, but build_and_deploy will be skipped.
- Go to the workflow run in Actions
- Click on Summary to see:
- Coverage metrics table
- E2E test status
- Download links for artifacts
- Download artifacts for detailed HTML reports
| Issue | Solution |
|---|---|
| "pnpm: command not found" | Ensure pnpm/action-setup runs BEFORE setup-node |
| Cache not working | Check cache-dependency-path points to correct lockfile |
| Playwright timeout | Increase timeout-minutes or check webServer config |
| Deployment fails | Verify secrets are set correctly |
| Tests pass locally but fail in CI | Check for environment differences (Node version, OS) |
- Check Job Summary for quick overview
- Download artifacts for detailed reports
- Expand failed step in workflow logs
- Check annotations on Files Changed tab (for PRs)
- Frontend Testing Strategy - Unit & E2E test details
- Backend README - API documentation
- Frontend README - Frontend setup
