Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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