Build Actions#

Execute Scade One model build actions.

Code generation#

The code-generation action generates code for a Scade One project and a given job.

Source code for this action

Input

Description

Required

Default

scade-dir

Scade One installation directory, e.g. 'C:\Program Files\Ansys Inc\v261\Scade One' or '/opt/AnsysInc/v261/ScadeOne/'.

True

project

Path of the Scade One project.

True

job-name

Name of the job to run. This is used to identify the job in the Scade One actions workflow.

True

target-dir

Path to the generated code, log and mapping files. If not provided, they will be saved in the 'output/code_generation' directory.

False

output/code_generation

artifact-name

Name of the artifact to upload.

False

Generated code and logs

python-version

Python version used for installation and execution of the build process.

False

3.10

use-python-cache

Whether to use the Python cache to install previously downloaded libraries.

False

pip

checkout

Whether to clone the repository on the CI/CD machine.

False

true

Example#

Code generation basic example
code-generation:
  name: "Code generation basic example"
  runs-on: [self-hosted, 'ScadeOne']
  steps:
    - name: "Generate code"
      uses: ansys/scadeone-actions/code-generation@v1.0
      with:
        scade-dir: 'C:\Program Files\Ansys Inc\v261\Scade One'
        project: 'Model\QuadFlightControl\QuadFlightControl.sproj'
        job-name: 'CodeGen'

Model check#

The model-check action runs a check in a Scade One project for a given job.

Source code for this action

Input

Description

Required

Default

scade-dir

Scade One installation directory, e.g. 'C:\Program Files\Ansys Inc\v261\Scade One' or '/opt/AnsysInc/v261/ScadeOne/'.

True

project

Path of the Scade One project.

True

job-name

Name of the job to run. This is used to identify the job in the Scade One actions workflow.

True

model-check-report

Path to the model check report file. If not provided, the report will be saved in the ‘output’ directory with the name 'model_check_report.txt'.

False

output/model_check_report.txt

artifact-name

Name of the artifact to upload.

False

Model check report

python-version

Python version used for installation and execution of the build process.

False

3.10

use-python-cache

Whether to use the Python cache to install previously downloaded libraries.

False

pip

checkout

Whether to clone the repository on the CI/CD machine.

False

true

Example#

Model check basic example
model-check:
  name: "Model check basic example"
  runs-on: [self-hosted, 'ScadeOne']
  steps:
    - name: "Check model"
      uses: ansys/scadeone-actions/model-check@v1.0
      with:
        scade-dir: 'C:\Program Files\Ansys Inc\v261\Scade One'
        project: 'Model\QuadFlightControl\QuadFlightControl.sproj'
        job-name: 'ModelCheckQuadFlightC'

Simulation#

The simulation action simulates a Scade One project for a given job.

Source code for this action

Input

Description

Required

Default

scade-dir

Scade One installation directory, e.g. 'C:\Program Files\Ansys Inc\v261\Scade One' or '/opt/AnsysInc/v261/ScadeOne/'.

True

project

Path of the Scade One project.

True

job-name

Name of the job to run. This is used to identify the job in the Scade One actions workflow.

True

target-dir

Path to the results of the simulation and logs. If not provided, they will be saved in the 'output/simu_results' directory.

False

output/simu_results

artifact-name

Name of the artifact to upload.

False

Simulation Results

python-version

Python version used for installation and execution of the build process.

False

3.10

use-python-cache

Whether to use the Python cache to install previously downloaded libraries.

False

pip

checkout

Whether to clone the repository on the CI/CD machine.

False

true

Example#

Simulation basic example
code-generation:
  name: "Simulation basic example"
  runs-on: [self-hosted, 'ScadeOne']
  steps:
    - name: "Simulate job"
      uses: ansys/scadeone-actions/simulation@v1.0
      with:
        scade-dir: 'C:\Program Files\Ansys Inc\v261\Scade One'
        project: 'Model\QuadFlightControl\QuadFlightControl.sproj'
        job-name: 'SimulationJob'

FMU export#

The fmu-export action builds a FMU package from a given Scade One operator. The FMU export supports the FMI 2.0 version for Model-Exchange and Co-Simulation.

Source code for this action

Input

Description

Required

Default

scade-dir

Scade One installation directory, e.g. 'C:\Program Files\Ansys Inc\v261\Scade One' or '/opt/AnsysInc/v261/ScadeOne/'.

True

project

Path of the Scade One project.

True

job-name

Name of the job to run. This is used to identify the job in the Scade One actions workflow.

True

kind

The FMI kind, ME for Model Exchange, CS for Co-Simulation.

False

ME

target-dir

Path to the output directory where the files are generated. If not provided, they will be saved in the 'output/fmu_gen' directory.

False

output/fmu_gen

artifact-name

Name for the uploaded artifact. This will be used as the name for the FMU archive.

False

fmu-file

python-version

Python version used for installation and execution of the build process.

False

3.10

use-python-cache

Whether to use the Python cache to install previously downloaded libraries.

False

pip

checkout

Whether to clone the repository on the CI/CD machine.

False

true

Limitations

Imported Type

The FMU export is not possible if imported types are used for any of the inputs or outputs of the selected operator, or sensors in the scope of the export.

Supported Platforms

This version only supports gcc compiler on 64-bits Windows platform.

Example#

FMU build basic example
fmu-export:
  name: "FMU build basic example"
  runs-on: [self-hosted, 'ScadeOne']
  steps:
    - name: "FMU export"
      uses: ansys/scadeone-actions/fmu-export@v1.0
      with:
        scade-dir: 'C:\Program Files\Ansys Inc\v261\Scade One'
        project: 'Model\QuadFlightControl\QuadFlightControl.sproj'
        job-name: 'CodeGen'