-
-
Notifications
You must be signed in to change notification settings - Fork 42
67 lines (57 loc) · 2.65 KB
/
Copy pathci.yml
File metadata and controls
67 lines (57 loc) · 2.65 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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET 10 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Restore dependencies
run: dotnet restore OriginalCircuit.Altium.sln
- name: Build
run: dotnet build OriginalCircuit.Altium.sln --no-restore --configuration Release
- name: Test
run: dotnet test tests/OriginalCircuit.Altium.Tests/ --no-build --configuration Release --logger "trx;LogFileName=test-results.trx" --results-directory ./test-results
- name: Report failed tests
if: failure()
run: |
python3 - <<'PY'
import glob, xml.etree.ElementTree as ET
ns = {'t': 'http://microsoft.com/schemas/VisualStudio/TeamTest/2010'}
for path in glob.glob('test-results/*.trx'):
for r in ET.parse(path).getroot().findall('.//t:UnitTestResult', ns):
if r.get('outcome') == 'Failed':
m = r.find('.//t:Message', ns)
msg = ' '.join((m.text or '').split()) if m is not None else ''
print(f"::error::FAILED {r.get('testName')} :: {msg[:300]}")
PY
- name: Run examples (smoke test)
run: |
dotnet run --project examples/ExtractBom --configuration Release --no-build
dotnet run --project examples/GeneratePickAndPlace --configuration Release --no-build
dotnet run --project examples/ExtractEmbeddedAssets --configuration Release --no-build
dotnet run --project examples/InspectBoard --configuration Release --no-build
dotnet run --project examples/NetReport --configuration Release --no-build
dotnet run --project examples/SchematicNetlist --configuration Release --no-build
dotnet run --project examples/BuildFootprintGenerator --configuration Release --no-build
dotnet run --project examples/BuildMultiPartComponent --configuration Release --no-build
dotnet run --project examples/WalkHierarchy --configuration Release --no-build
dotnet run --project examples/DiffLibraries --configuration Release --no-build
dotnet run --project examples/ValidateLibrary --configuration Release --no-build
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: ./test-results/*.trx
retention-days: 30