Skip to content

Commit

Permalink
move plcsim folder one level up to be useable also with axopen.templa…
Browse files Browse the repository at this point in the history
…tes (#586)

* Create draft PR for #585

* plcsim folder moved one level up

* Cleaning of the JSONREPOS folder added

* JSONREPOS folders removed

* JSONREPS added to gitignore

* IP addresses alligned

* more grannular scripts added

* relative paths to scripts fixed

* IP addresses in HMI apps fixed

* wip

* cake-more detailed single app run test added

* script typo fixed

* relative certification paths modified plus/minus one level up or down to be able to start the app, no hell idea why it differs between the libraries of the same folder structure

* single app run wokflow, manually triggered for selected folder added

* moved all app run test folder one level up

* wip

* forgoten commit

* wip

* cleaning of the generated files for template.axopenlibrary added, so as addition dotne ixc run for simple app test run

* single app run test summary evaluation added

* additional clean and dotnet ixc run for template.axolibrary added, plus sumarry evaluation
  • Loading branch information
TomKovac authored Feb 11, 2025
1 parent a08419d commit d86a0a2
Show file tree
Hide file tree
Showing 96 changed files with 2,442 additions and 2,527 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/single_app_run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: nightly

on:
workflow_dispatch:
inputs:
folder:
description: "Select library folder (abstractions, components.abb.robotics, components.abstractions)"
required: true
default: "template.axolibrary"
type: choice
options:
- abstractions
- components.abb.robotics
- components.abstractions
- components.balluff.identification
- components.cognex.vision
- components.desoutter.tightening
- components.drives
- components.elements
- components.festo.drives
- components.kuka.robotics
- components.mitsubishi.robotics
- components.pneumatics
- components.rexroth.drives
- components.rexroth.press
- components.robotics
- components.siem.identification
- components.ur.robotics
- core
- data
- inspectors
- integrations
- io
- probers
- simatic1500
- template.axolibrary
- timers
- utils
jobs:
app-run-manual-with-selected-folder:
runs-on: [self-hosted, Windows, X64, L3, AX, APP]
steps:
- name: Get Branch Name
shell: pwsh
run: |
if ($env:GITHUB_REF -like "refs/pull/*") {
$BRANCH_NAME = "${{ github.event.pull_request.head.ref }}"
} else {
$BRANCH_NAME = $env:GITHUB_REF -replace 'refs/heads/', ''
}
Write-Host "Triggered on branch: $BRANCH_NAME"
"BRANCH_NAME=$BRANCH_NAME" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Print Inputs
run: |
$APP_FOLDER=${{ github.event.inputs.folder }}
echo "Selected folder: $APP_FOLDER"
"APP_FOLDER=$APP_FOLDER" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: '0'

- name: "Build cake"
run: dotnet build cake/Build.csproj

- name: "Run cake with single app"
env:
GH_TOKEN : ${{ secrets.GH_TOKEN }}
GH_USER : ${{ secrets.GH_USER }}
run: dotnet run --project cake/Build.csproj --skip-build --apps-run --single-app-run-folder-name $env:APP_FOLDER
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -429,4 +429,7 @@ library_templates
#DCP export
dcp_export/

*.apax.tgz
*.apax.tgz

#JSONREPOS
**/JSONREPOS/
52 changes: 51 additions & 1 deletion cake/ApaxCmd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,58 @@ public static void ApaxInstall(this BuildContext context, string folder)
}).WaitForExit();
context.Log.Information($"apax {apaxArguments} completed successfully in '{folder}'");
}
public static string ApaxCommand(this BuildContext context, string folder, string apaxCommand, ref bool summaryResult)
{
string retVal = ",NOK";

context.Log.Information($"apax {apaxCommand} started in '{folder}'");

var processSettings = new ProcessSettings()
{
Arguments = apaxCommand,
WorkingDirectory = folder,
RedirectStandardOutput = true,
RedirectStandardError = true,
Silent = false
};

using (var process = context.ProcessRunner.Start(Helpers.GetApaxCommand(), processSettings))
{
if (process == null)
{
summaryResult = false;
throw new Exception("Failed to start the process.");
}

process.WaitForExit();

var standardOutput = process.GetStandardOutput();
var standardError = process.GetStandardError();


// Check the exit code and handle result
if (process.GetExitCode() == 0)
{
foreach (string line in standardOutput)
{
context.Log.Information(line);
}
context.Log.Information($"apax {apaxCommand} completed successfully in '{folder}'");
retVal = ",OK";
}
else
{
summaryResult = false;
foreach (string line in standardError)
{
context.Log.Error(line);
}
context.Log.Error($"apax {apaxCommand} failed with exit code: {process.GetExitCode()} in '{folder}'");
context.Log.Error($"Error Output: {standardError}");
}
return retVal;
}
}
public static string ApaxPlcSim(this BuildContext context, string folder, ref bool summaryResult)
{
string retVal = ",NOK";
Expand Down Expand Up @@ -109,7 +160,6 @@ public static string ApaxPlcSim(this BuildContext context, string folder, ref bo
return retVal;
}
}

public static string ApaxHwu(this BuildContext context, string folder, ref bool summaryResult)
{
string retVal = ",NOK";
Expand Down
Loading

0 comments on commit d86a0a2

Please sign in to comment.