Skip to content

Commit 982c234

Browse files
authored
80 create GitHub actions workflow to upload architecture into polarion (#109)
* Add workflow to upload architecture model to Polarion on branch push * Update copyright to remove Robert Bosch GmbH from license header * Add note on main branch push uploading Architecture to Polarion * Enable workflow to run only on push events to main branch
1 parent bee6efa commit 982c234

3 files changed

Lines changed: 94 additions & 1 deletion

File tree

.github/workflows/UpdatePolarionByComments.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) LieberLieber GmbH & Robert Bosch GmbH
1+
# Copyright (c) LieberLieber GmbH
22
# This Source Code Form is subject to the terms of the Mozilla Public
33
# License, v. 2.0. If a copy of the MPL was not distributed with this
44
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Copyright (c) LieberLieber Software GmbH
2+
# This Source Code Form is subject to the terms of the Mozilla Public
3+
# License, v. 2.0. If a copy of the MPL was not distributed with this
4+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
5+
6+
name: Upload Architecture to Polarion
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
13+
env:
14+
ModelName: LemonTree.DevOps.Demo.qeax
15+
ToolPolarionAutomationURL : https://www.lieberlieber.com/polarion/automation/latest/
16+
PackageGuid: '{A7B2B212-BD09-483c-9946-ADD1417DE7CD}' #this is the package guid of the Architecture to export to Polarion
17+
18+
# cached executable paths used by tool setup steps
19+
LTC_DIR: ${{ github.workspace }}\_toolcache\LTC
20+
SqliteToolsDir: ${{ github.workspace }}\_toolcache\sqlite-tools
21+
22+
jobs:
23+
UploadArchitecture:
24+
defaults:
25+
run:
26+
shell: pwsh
27+
runs-on: [windows-latest]
28+
timeout-minutes: 15
29+
steps:
30+
- uses: actions/checkout@v6.0.2
31+
with:
32+
lfs: true
33+
fetch-depth: 0
34+
35+
36+
- name: PrepareLTALicense #on the private runner LemonTree Automation is preinstalled. we just get the license
37+
run: |
38+
'${{secrets.LTALICENSE}}' | Out-File -FilePath lta.lic
39+
40+
# Custom action to setup LemonTree.Connect Automation that supports caching
41+
- name: Setup LemonTree.Connect
42+
uses: ./.github/actions/setup-ltc
43+
id: ltc_setup
44+
with:
45+
tool-url: ${{ env.ToolPolarionAutomationURL }}
46+
ltc-dir: ${{ env.LTC_DIR }}
47+
48+
# Custom action to setup SQLite3 that supports caching
49+
- name: Setup SQLite3
50+
uses: ./.github/actions/setup-sqlite
51+
with:
52+
sqlite-tools-dir: ${{ env.SqliteToolsDir }}
53+
54+
- name: Extract LemonTree.Connect Mapping Configuration from Model
55+
id: extractMapping
56+
run: |
57+
# Query the model for the mapping configuration
58+
$query = "select notes from t_objectproperties where property = 'configuration' and object_id in (select object_id from t_object where ea_guid = '${{env.PackageGuid}}')"
59+
$mappingXml = & .\scripts\QueryModelSqliteExe.ps1 -Model "${{env.ModelName}}" -Query $query
60+
# Extract just the XML content (skip the script's info messages)
61+
$xmlContent = $mappingXml | Where-Object { $_ -match '<map' -or $_ -match '</' -or $_ -match '<[^>]+>' } | Out-String
62+
# Save to file
63+
$xmlContent | Out-File -FilePath "packagemapping.xml" -Encoding UTF8
64+
Write-Output "Mapping file created: packagemapping.xml"
65+
$mappingPath = Resolve-Path "packagemapping.xml"
66+
Write-Output "MappingFile=$mappingPath" >> $env:GITHUB_OUTPUT
67+
68+
- name: Export Architecture to Polarion
69+
id: export_architecture
70+
run: |
71+
echo "Starting export of architecture to Polarion..."
72+
$exportOutput = &"${{steps.ltc_setup.outputs.tool-path}}" Export --Model "${{env.ModelName}}" --PackageGuid "${{env.PackageGuid}}" --Project "LT.Connect" --Mapping "${{steps.extractMapping.outputs.MappingFile}}" --ServerUrl "https://testdrive.polarion.com/polarion/" --Username "0ee265a99e504e639b4fe954739dd14e" --token "${{secrets.POLARIONTOKEN}}" --License "lta.lic"
73+
74+
Write-Output "Export output:"
75+
Write-Output $exportOutput
76+
77+
if ($LASTEXITCODE -eq 0) {
78+
Write-Output "message=:heavy_check_mark: Architecture successfully exported to Polarion" >> $env:GITHUB_OUTPUT
79+
Write-Output "export_status=success" >> $env:GITHUB_OUTPUT
80+
} else {
81+
Write-Output "::error::Architecture export to Polarion failed"
82+
Write-Output "message=:x: Architecture export failed, see [action log](${{env.GitHubProjectRoot}}/actions/runs/${{ github.run_id }}) for details" >> $env:GITHUB_OUTPUT
83+
Write-Output "export_status=failed" >> $env:GITHUB_OUTPUT
84+
exit 1
85+
}
86+
87+
- name: Publish MD to Action Summary
88+
run: |
89+
$branch = git branch --show-current
90+
Write-Output "### Architecture Upload to Polarion - Branch: $branch :rocket:" >> $env:GITHUB_STEP_SUMMARY
91+
Write-Output "${{steps.export_architecture.outputs.message}}" >> $env:GITHUB_STEP_SUMMARY

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ In complex engineering landscapes, particularly when you’re working with SysML
1414
- Automation ensures that your MBSE artifacts evolve — and that your team can apply standard DevOps best practices (branching, merging, CI/CD) to architectural models just as you do to software.
1515

1616
- You benefit from full traceability between model changes, version control, and engineering outcomes — helping you maintain consistency, enable collaboration, and reduce manual error in system-model lifecycles.
17+
18+
- on Push to main the Architecture get's uploaded to Polarion - see [Polarion Testdrive]](https://testdrive.polarion.com/polarion/#/project/LT.Connect/workitems?query=NOT%20type%3A(requirement%20systemrequirement%20softwarerequirement%20systemtestcase%20heading)&link_role=parent&tree_depth=7&tab=tree)
1719

1820

1921
In short: this repository demonstrates how to **bring DevOps to MBSE** by integrating GitHub, Enterprise Architect models, and LemonTree’s automation capabilities — turning what used to be a manual, fragmented workflow into a continuous, model-aware pipeline.

0 commit comments

Comments
 (0)