-
Notifications
You must be signed in to change notification settings - Fork 1
Migrate VarTools from Jenkins to Github Actions #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 22 commits
f6bd746
e3c83a3
d1165c1
9e21fc0
6a9983d
82a3408
37e2940
5b35c26
17dc777
6bb9c5c
535a384
95fa99d
db07557
ca5034f
816f650
520a9a1
43a3071
a81bb09
93e1c21
f20d1a5
2d41cac
75187b3
5e06cf5
5fc1af8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* -text | ||
*.exe filter=lfs diff=lfs merge=lfs -text |
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 | ||
Joshpolansky marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Install AS upgrades | ||
run: python.exe C:/Tools/AsPython/InstallUpgrades.py ${{ github.workspace }}/main/upgrades -asp AS411 -r --logLevel DEBUG | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" |
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* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
This file was deleted.
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> |
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) | ||
{ | ||
} | ||
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 |
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> |
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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
Uh oh!
There was an error while loading. Please reload this page.