Repository navigation
110 lines (92 loc) · 2.83 KB
/
Copy pathintegration-tests.yml
File metadata and controls
110 lines (92 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Integration Tests (Self-Hosted)
# This workflow is designed to run on a self-hosted Windows runner
# with SolidWorks installed. It can be triggered manually or on a schedule.
on:
workflow_dispatch:
inputs:
sw-version:
description: 'SolidWorks version to test'
required: true
default: '2024'
type: choice
options:
- '2021'
- '2022'
- '2023'
- '2024'
- '2025'
schedule:
# Run nightly at 2 AM UTC
- cron: '0 2 * * *'
env:
NODE_VERSION: '20.x'
jobs:
integration-test:
name: Integration Tests (SW ${{ github.event.inputs.sw-version || '2024' }})
runs-on: [self-hosted, windows, solidworks]
timeout-minutes: 60
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Verify SolidWorks Installation
shell: pwsh
run: |
$swPath = "C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\SLDWORKS.exe"
if (-not (Test-Path $swPath)) {
throw "SolidWorks not found at expected location: $swPath"
}
# Get SolidWorks version
$version = (Get-Item $swPath).VersionInfo.ProductVersion
Write-Host "SolidWorks version: $version"
- name: Build
run: npm run build
- name: Run Integration Tests
run: npm run test:integration
env:
SOLIDWORKS_VERSION: ${{ github.event.inputs.sw-version || '2024' }}
USE_MOCK_SOLIDWORKS: false
LOG_LEVEL: debug
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v7
with:
name: integration-test-results-${{ github.event.inputs.sw-version || '2024' }}
path: |
test-results/
logs/
retention-days: 14
- name: Upload Screenshots (on failure)
if: failure()
uses: actions/upload-artifact@v7
with:
name: failure-screenshots-${{ github.run_number }}
path: screenshots/
retention-days: 7
report:
name: Generate Test Report
runs-on: ubuntu-latest
needs: [integration-test]
if: always()
steps:
- name: Download Test Results
uses: actions/download-artifact@v8
with:
pattern: integration-test-results-*
merge-multiple: true
- name: Generate HTML Report
run: |
# Generate test report
echo "Test report generation would go here"
- name: Upload Report
uses: actions/upload-artifact@v7
with:
name: integration-test-report
path: test-report.html
retention-days: 30