Skip to content

Commit

Permalink
wip: First version
Browse files Browse the repository at this point in the history
  • Loading branch information
ewuerger committed Oct 6, 2023
1 parent 233b0d5 commit 5b2093b
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions ci-templates/github/model-validation/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# SPDX-FileCopyrightText: Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

name: "Capella Model-Validation"
description: "An action to validate a Capella model."

inputs:
entry_point:
description: "The entry point of the used model"
capella_docker_images_revision:
description: "The revision of capella-dockerimages to use"
default: main
capella_docker_images_dropins:
description: "Please have a look at https://dsd-dbs.github.io/capella-dockerimages/capella/introduction/#supported-dropins"
required: false
default: selected

runs:
using: "composite"
steps:
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Extract branch name and print
shell: bash
run: echo "Branch is $(echo ${{ github.ref }} | cut -d'/' -f3)"
- name: Execute Model-Validation with Capella CLI
shell: bash
run: >
# As our containers run with techuser (non-root) git commands fail with dubious ownership, see <https://gitlab.com/gitlab-org/gitlab-runner/-/issues/29022> for the solution.
- git config --global --add safe.directory ${CI_PROJECT_DIR}
- git fetch
- if [ ! -z $CI_COMMIT_BRANCH ]; then git reset --hard origin/$CI_COMMIT_BRANCH; fi
- BUILD_DIR=$(pwd)
- if [ ! -f ".project" ]; then echo "The model validator requires a '.project' file!" && exit 1; fi
- 'if [[ "$(dirname "{{ inputs.entry_point }}")" != "." ]]; then echo ''The model validator requires a "*.aird" in the root level of the repository!'' && exit 1; fi'
- mkdir /tmp/project
- cp -r . /tmp/project
- cd /tmp
- >
xvfb-run /opt/capella/capella
-nosplash
-application org.polarsys.capella.core.commandline.core
-appid org.polarsys.capella.core.validation.commandline
-data "$(pwd)"
-input "project/{{ inputs.entry_point }}"
-outputfolder "project/validation"
- cp "/tmp/project/validation/project/{{ inputs.entry_point }}/validation-results.html" $BUILD_DIR
- name: Archive model-validation in artifacts
uses: actions/upload-artifact@v3
with:
name: Validation reports
path: $(pwd)

0 comments on commit 5b2093b

Please sign in to comment.