Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Example Tests
# This workflow runs tests for the DevExpress Angular Report Designer frontend.

on:
push:
branches:
- '[0-9]+.[0-9]+.[0-9]+\+' # Matches xx.x.x+ pattern
pull_request:
branches:
- '[0-9]+.[0-9]+.[0-9]+\+' # Matches xx.x.x+ pattern
workflow_dispatch: # Allows manual triggering

env:
NODE_VERSION: '20'
DOTNET_VERSION: '8.0.x'

jobs:
test:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: |
package-lock.json
angular-report-designer/package-lock.json

- name: Cache Playwright browsers
uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
~/AppData/Local/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-playwright-

- name: Setup Chrome
uses: browser-actions/setup-chrome@v1
with:
chrome-version: stable

- name: Install Playwright browsers
run: |
if (Test-Path "$env:USERPROFILE\AppData\Local\ms-playwright\chromium*") {
Write-Host "Playwright browsers already installed"
} else {
Write-Host "Installing Playwright browsers..."
npx playwright install --with-deps
}
shell: pwsh

- name: Run Tests
shell: pwsh
run: |
try {
& "test/main-test.ps1"
if ($LASTEXITCODE -ne 0) {
Write-Host "❌ Tests failed with exit code: $LASTEXITCODE" -ForegroundColor Red
exit $LASTEXITCODE
}
Write-Host "✅ Tests passed successfully" -ForegroundColor Green
}
catch {
Write-Host "❌ Test execution failed: $($_.Exception.Message)" -ForegroundColor Red
exit 1
}

5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ FakesAssemblies/
.ntvs_analysis.dat
node_modules/

# Playwright Test Results
test-results/
playwright-report/
playwright/.cache/

# Typescript v1 declaration files
typings/

Expand Down
3 changes: 3 additions & 0 deletions angular-report-designer/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,8 @@
}
}
}
},
"cli": {
"analytics": false
}
}
Loading
Loading