Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f6bd746
Add build and buildpublish workflows
sclaiborne Feb 2, 2024
e3c83a3
Fix tokens in build workflow
sclaiborne Feb 3, 2024
d1165c1
Set exe files to use git lfs
sclaiborne Feb 3, 2024
9e21fc0
Add upgrades needed to build
sclaiborne Feb 3, 2024
6a9983d
Add runs on scott tag for debugging
sclaiborne Feb 13, 2024
82a3408
Update build publish pipeline name
sclaiborne Feb 13, 2024
37e2940
Remove comments in build pipeline
sclaiborne Feb 13, 2024
5b35c26
Fix PAT in build publish
sclaiborne Feb 13, 2024
17dc777
Remove setup node
sclaiborne Feb 13, 2024
6bb9c5c
Rename build job
sclaiborne Feb 13, 2024
535a384
update build action line ending
sclaiborne Feb 13, 2024
95fa99d
Update line endings
sclaiborne Feb 13, 2024
db07557
Update run tags
sclaiborne Apr 19, 2024
ca5034f
Add get value to default program
sclaiborne Apr 19, 2024
816f650
Add missing upgrade to build ARM systems
sclaiborne Apr 19, 2024
520a9a1
Use ASPython and LPM on Agent
sclaiborne Apr 30, 2024
43a3071
Use AsPython to install upgrades instead of powershell
sclaiborne May 1, 2024
a81bb09
Set logging level of install upgrades to info
sclaiborne May 1, 2024
93e1c21
Increase install upgrades log verbosity
sclaiborne May 1, 2024
f20d1a5
Update python paths to be absolute
sclaiborne May 1, 2024
2d41cac
Update Build Publish worflow to follow new standard
sclaiborne May 1, 2024
75187b3
Remove Jenkins pipeline from repo
sclaiborne May 1, 2024
5e06cf5
Add a dispatch to allow for manual builds
Joshpolansky Sep 11, 2024
5fc1af8
Merge branch 'main' into feature/workflows
Joshpolansky Sep 11, 2024
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* -text
*.exe filter=lfs diff=lfs merge=lfs -text
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will run build an AS project and publish the libraries to the github package registry

name: Build Libraries

on:
push:
branches-ignore:
- 'main'

jobs:
build-libraries:
runs-on: [AS411]
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
path: "main"
lfs: true
- name: Fix LFS
run: |
cd ./main
git lfs pull
- name: Install AS upgrades
run: python.exe C:/Tools/AsPython/InstallUpgrades.py ${{ github.workspace }}/main/upgrades -asp AS411 -r --logLevel DEBUG

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is dependent upon AsPython already existing on the runner, right? This feels like the correct way to do it in general, but how do you propose we handle AsPython changes if for example we only want a subset of all repos to use a new version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The runner will have AsPython main (pulled daily). IF you wanted a specific version, no problem. Add a checkout and use that instead. Example:

# This workflow will run build an AS project and publish the libraries to the github package registry
name: Build Libraries
on: 
  push:
    branches-ignore:
      - 'main'
jobs:
  build-libraries:
    runs-on: [AS411]
    permissions:
      contents: read
      packages: write
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: 'true'
          path: "main"
          lfs: true
      - uses: actions/checkout@v4
        with:
          repository: "loupeteam/ASPython"
          submodules: 'true'
          ref: "bugfix/pvi-error-code"
          path: "AsPython"
      - name: Fix LFS
        run:  |
          cd ./main
          git lfs pull
      - name: Install AS upgrades
        shell: pwsh
        run: |
          Set-Location -Path ./main/upgrades
          & $PWD/install.ps1
      - run: python.exe ./AsPython/CmdLineBuild.py ./main/example/AsProject/AsProject.apj -c Intel ARM -bm Rebuild -sim --logLevel DEBUG
      - run: python.exe ./AsPython/CmdLineExportLib.py ./main/example/AsProject/AsProject.apj -dest ./libs -c Intel ARM -wl vartools -l DEBUG -o -bm "None"

- name: Build project
run: python.exe C:/Tools/AsPython/CmdLineBuild.py ${{ github.workspace }}/main/example/AsProject/AsProject.apj -c Intel ARM -bm Rebuild -sim --logLevel DEBUG
- name: Export libraries
run: python.exe C:/Tools/AsPython/CmdLineExportLib.py ${{ github.workspace }}/main/example/AsProject/AsProject.apj -dest ./libs -c Intel ARM -wl vartools -l DEBUG -o -bm "None"
39 changes: 39 additions & 0 deletions .github/workflows/buildPublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will run build an AS project and publish the libraries to the github package registry

name: Build Publish Libraries

on:
push:
branches:
- main
tags:
- v*

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this setup with the two workflows makes sense - you want to auto-build and export commits from all branches except for main, and you want to build and publish for either main pushes or specific tag events. Am I understanding the intent correctly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct.

I think maybe a better solution would be one workflow that has steps that are conditional but I didnt want to spend time on that yet.


jobs:
build-publish-libraries:
runs-on: [AS411]
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
path: "main"
lfs: true
- name: Fix LFS
run: |
cd ./main
git lfs pull
- name: Install AS upgrades
run: python.exe C:/Tools/AsPython/InstallUpgrades.py ${{ github.workspace }}/main/upgrades -asp AS411 -r --logLevel DEBUG
- name: Build project
run: python.exe C:/Tools/AsPython/CmdLineBuild.py ${{ github.workspace }}/main/example/AsProject/AsProject.apj -c Intel ARM -bm Rebuild -sim --logLevel DEBUG
- name: Export libraries
run: python.exe C:/Tools/AsPython/CmdLineExportLib.py ${{ github.workspace }}/main/example/AsProject/AsProject.apj -dest ./libs -c Intel ARM -wl vartools -l DEBUG -o -bm "None"
- name: Publish libraries
run: |
cd ./libs/vartools
python.exe C:/Tools/LPM/src/LPM.py login -s -t ${{ secrets.GITHUB_TOKEN }} -nc
python.exe C:/Tools/LPM/src/LPM.py init -s -lib -nc
python.exe C:/Tools/LPM/src/LPM.py publish -s -nc
11 changes: 0 additions & 11 deletions Jenkinsfile

This file was deleted.

24 changes: 12 additions & 12 deletions example/AsProject/AsProject.apj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version="4.11.5.46 SP" WorkingVersion="4.11"?>
<Project Description="Starter Automation Studio project." Version="1.00.0" Edition="Standard" EditionComment="Standard" xmlns="http://br-automation.co.at/AS/Project">
<Communication />
<ANSIC DefaultIncludes="true" />
<IEC ExtendedConstants="true" IecExtendedComments="true" KeywordsAsStructureMembers="false" NamingConventions="true" Pointers="true" Preprocessor="false" />
<Motion RestartAcoposParameter="true" RestartInitParameter="true" />
<Project StoreRuntimeInProject="false" />
<Variables DefaultInitValue="0" DefaultRetain="false" DefaultVolatile="true" />
<TechnologyPackages>
<Acp10Arnc0 Version="5.15.1" />
</TechnologyPackages>
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version="4.11.4.55 SP" WorkingVersion="4.11"?>
<Project Description="Starter Automation Studio project." Version="1.00.0" Edition="Standard" EditionComment="Standard" xmlns="http://br-automation.co.at/AS/Project">
<Communication />
<ANSIC DefaultIncludes="true" />
<IEC ExtendedConstants="true" IecExtendedComments="true" KeywordsAsStructureMembers="false" NamingConventions="true" Pointers="true" Preprocessor="false" />
<Motion RestartAcoposParameter="true" RestartInitParameter="true" />
<Project StoreRuntimeInProject="false" />
<Variables DefaultInitValue="0" DefaultRetain="false" DefaultVolatile="true" />
<TechnologyPackages>
<Acp10Arnc0 Version="5.15.1" />
</TechnologyPackages>
</Project>
44 changes: 22 additions & 22 deletions example/AsProject/Logical/Programs/Default/Main.c
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@

#include <bur/plctypes.h>

#ifdef _DEFAULT_INCLUDES
#include <AsDefault.h>
#endif

void _INIT ProgramInit(void)
{

}

void _CYCLIC ProgramCyclic(void)
{

}

void _EXIT ProgramExit(void)
{

}

#include <bur/plctypes.h>
#ifdef _DEFAULT_INCLUDES
#include <AsDefault.h>
#endif
void _INIT ProgramInit(void)
{
}
void _CYCLIC ProgramCyclic(void)
{
varGetValue(&var);
}
void _EXIT ProgramExit(void)
{
}
11 changes: 3 additions & 8 deletions example/AsProject/Logical/Programs/Default/Variables.var
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@

VAR

END_VAR

VAR CONSTANT

END_VAR
VAR
var : varVariable_typ;
END_VAR
55 changes: 28 additions & 27 deletions example/AsProject/Physical/Intel/5PC900_TS17_04/Cpu.pkg
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio FileVersion="4.9"?>
<Cpu xmlns="http://br-automation.co.at/AS/Cpu">
<Objects>
<Object Type="File" Description="Software configuration">Cpu.sw</Object>
<Object Type="File" Description="Permanent variables">Cpu.per</Object>
<Object Type="File" Description="I/O mapping">IoMap.iom</Object>
<Object Type="File" Description="Variable mapping">PvMap.vvm</Object>
<Object Type="Package">Connectivity</Object>
<Object Type="Package">TextSystem</Object>
<Object Type="Package">UnitSystem</Object>
<Object Type="Package">AccessAndSecurity</Object>
<Object Type="Package">mappControl</Object>
<Object Type="Package">mappMotion</Object>
<Object Type="Package">mappServices</Object>
<Object Type="Package">mappView</Object>
<Object Type="Package">mappVision</Object>
<Object Type="Package">mappCockpit</Object>
<Object Type="Package">Motion</Object>
</Objects>
<Configuration ModuleId="5PC900.TS17-04">
<AutomationRuntime Version="C4.90" />
<Build GccVersion="6.3.0" PreBuildStep="" />
<DefaultTargetMemory Tasks="UserROM" />
<Safety SafetyRelease="0.0" />
<Vc FirmwareVersion="V4.72.5" />
</Configuration>
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio FileVersion="4.9"?>
<Cpu xmlns="http://br-automation.co.at/AS/Cpu">
<Objects>
<Object Type="File" Description="Software configuration">Cpu.sw</Object>
<Object Type="File" Description="Permanent variables">Cpu.per</Object>
<Object Type="File" Description="I/O mapping">IoMap.iom</Object>
<Object Type="File" Description="Variable mapping">PvMap.vvm</Object>
<Object Type="Package">Connectivity</Object>
<Object Type="Package">TextSystem</Object>
<Object Type="Package">UnitSystem</Object>
<Object Type="Package">AccessAndSecurity</Object>
<Object Type="Package">mappControl</Object>
<Object Type="Package">mappMotion</Object>
<Object Type="Package">mappServices</Object>
<Object Type="Package">mappView</Object>
<Object Type="Package">mappVision</Object>
<Object Type="Package">mappCockpit</Object>
<Object Type="Package">Motion</Object>
</Objects>
<Configuration ModuleId="5PC900.TS17-04">
<AutomationRuntime Version="C4.90" />
<Build GccVersion="6.3.0" PreBuildStep="" />
<DefaultTargetMemory Tasks="UserROM" />
<Safety SafetyRelease="0.0" />
<Transfer SavedOfflineInstallationFolder="" SavedPipDestinationFolder="" SavedRuntimeUtilityCenterPackagePath="" />
<Vc FirmwareVersion="V4.72.5" />
</Configuration>
</Cpu>
3 changes: 2 additions & 1 deletion example/AsProject/Physical/Intel/Hardware.hw
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=4.11.4.55 FileVersion="4.9"?>
<Hardware xmlns="http://br-automation.co.at/AS/Hardware">
<Module Name="5AC901.IPLK-00" Type="5AC901.IPLK-00" Version="1.8.0.1">
<Connection Connector="SS" TargetModule="5PC910.SX02-00" TargetConnector="SS2" />
Expand Down
3 changes: 3 additions & 0 deletions upgrades/5AC901.IPLK-00/1.7.1.0/AS4_HW_5AC901.IPLK-00.exe
Git LFS file not shown
3 changes: 3 additions & 0 deletions upgrades/5PC900.TS17-04/2.1.0.0/AS4_HW_5PC900.TS17-04.exe
Git LFS file not shown
3 changes: 3 additions & 0 deletions upgrades/AS4_AR_B0491_X20CP04xx.exe
Git LFS file not shown
3 changes: 3 additions & 0 deletions upgrades/AS4_AR_C0490_APC9xxS.exe
Git LFS file not shown
11 changes: 11 additions & 0 deletions upgrades/install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# set environment variables
$env:AS_VERSION_SHORT = 'AS411'
Get-ChildItem "$PWD" -Recurse -Filter *.exe | Foreach-Object {
Write-Output "installing $($_.Name)";
Write-Verbose "Into C:\BrAutomation\$env:AS_VERSION_SHORT";
& $_.FullName -G='C:\BrAutomation' -V="C:\BrAutomation\$env:AS_VERSION_SHORT" -R | Out-Null;
if($LASTEXITCODE -ne 0) {
Write-Error "Error installing $($_.Name). Exit code $LASTEXITCODE";
exit 1;
}
}
Comment on lines +1 to +11

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you're now using AsPython for upgrades, is this Powershell script still needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not needed but I like the script. It can be used by people who are new to the project that want to install the upgrades