Skip to content

Commit

Permalink
Changes to run properly in act
Browse files Browse the repository at this point in the history
Mounts don't seem to work properly in act, so copying files instead.
Fix Default.Document resource processor to not force a category subdirectory
  • Loading branch information
isc-tleavitt committed Jan 30, 2024
1 parent 3d00bf6 commit e5b48e9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 17 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,17 @@ jobs:
-e TEST_REGISTRY=http://registry:52773/registry/ \
-e TEST_REGISTRY_USER=admin \
-e TEST_REGISTRY_PASSWORD=SYS \
-v `pwd`:/home/irisowner/zpm/ \
zpm ${{ steps.image.outputs.flags }}
CONTAINER=`docker ps -lq`
sleep 5; docker exec $CONTAINER /usr/irissys/dev/Cloud/ICM/waitISC.sh
docker cp . $CONTAINER:/home/irisowner/zpm/
echo `docker exec -i --workdir /home/irisowner/zpm/ $CONTAINER ls -rtl`
/bin/echo -e '' \
'zpm "list":1\n' \
'zpm "test zpm -v -only":1\n' \
'zpm "verify zpm -v -only":1' \
'zpm "test zpm -v -only"\n' \
'zpm "verify zpm -v -only"\n' \
'halt\n' \
| docker exec -i $CONTAINER iris session iris -U%SYS
docker logs $CONTAINER
| docker exec -i $CONTAINER iris session iris -UUSER
docker stop $CONTAINER
- name: Restart temporary registry
timeout-minutes: 15
Expand All @@ -124,10 +124,10 @@ jobs:
- name: Test and publish to temporary registry
timeout-minutes: 15
run: |
docker run --network zpm -d --rm -v `pwd`:/home/irisowner/zpm/ zpm ${{ steps.image.outputs.flags }} \
--log-driver=none -a stdin -a stdout -a stderr
docker run --network zpm -d --rm zpm ${{ steps.image.outputs.flags }}
CONTAINER=`docker ps -lq`
sleep 5; docker exec $CONTAINER /usr/irissys/dev/Cloud/ICM/waitISC.sh
docker cp . $CONTAINER:/home/irisowner/zpm/
/bin/echo -e '' \
'zpm "repo -r -name registry -url https://pm.community.intersystems.com/":1\n' \
'zpm "repo -list":1\n' \
Expand All @@ -139,7 +139,7 @@ jobs:
'zpm "publish sslclient -v":1' \
'zpm "search":1' \
'halt\n' \
| docker exec -i $CONTAINER iris session iris -U%SYS
| docker exec -i $CONTAINER iris session iris -UUSER
docker logs $CONTAINER
docker stop $CONTAINER
# - name: Clean install current version and test new one. (Permitted to fail on 2023.1+)
Expand All @@ -163,7 +163,7 @@ jobs:
# 'zpm "list":1\n' \
# 'zpm "version":1\n' \
# 'halt\n' \
# | docker exec -i $CONTAINER iris session iris -U%SYS
# | docker exec -i $CONTAINER iris session iris -UUSER
# docker stop $CONTAINER
- name: Clean install and test
timeout-minutes: 15
Expand Down Expand Up @@ -191,6 +191,8 @@ jobs:
- name: Stop temporary registry
if: always()
run: |
CONTAINER=`docker ps -lq`
docker stop $CONTAINER
docker stop registry
docker network rm zpm
- uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -240,7 +242,7 @@ jobs:
run: |
sed -i -E "s/<Version>(.*)<\/Version>/<Version>${VERSION}<\/Version>/" module.xml
cat module.xml
docker run -d --rm -v `pwd`:/home/irisowner/zpm/ containers.intersystems.com/intersystems/${{ needs.prepare.outputs.main }} --check-caps false
docker run -d --rm -v $(pwd):/home/irisowner/zpm/ containers.intersystems.com/intersystems/${{ needs.prepare.outputs.main }} --check-caps false
CONTAINER=`docker ps -lq`
sleep 5; docker exec $CONTAINER /usr/irissys/dev/Cloud/ICM/waitISC.sh
/bin/echo -e '' \
Expand All @@ -249,7 +251,7 @@ jobs:
'zpm "repo -r -name registry -url ""https://pm.community.intersystems.com/"" -username ${{ secrets.REGISTRY_USERNAME }} -password ${{ secrets.REGISTRY_PASSWORD }}":1\n' \
'zpm "publish zpm -v":1' \
'halt\n' \
| docker exec -i $CONTAINER iris session iris -U%SYS
| docker exec -i $CONTAINER iris session iris -UUSER
docker stop $CONTAINER
- name: Upload Public Release Asset
uses: actions/upload-release-asset@v1
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"host": "localhost",
"username": "_system",
"password": "SYS",
"ns": "%SYS"
"ns": "USER"
},
"intersystems.testingManager.client.relativeTestRoot": "tests/unit_tests"
}
7 changes: 5 additions & 2 deletions iris.script
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
zn "USER"
do $System.OBJ.Load("/home/irisowner/zpm/Installer.cls","ck")
do ##class(IPM.Installer).setup("/home/irisowner/zpm/",3)
do ##class(%IPM.Main).Shell("install vscode-per-namespace-settings")
set ^UnitTestRoot="/usr/irissys/.vscode/%SYS/UnitTestRoot"
zpm "repo -n registry -url repo -r -name registry -url https://pm.community.intersystems.com/"
halt

// Currently broken for %IPM due to differing default behavior for packages starting with % - vscode-per-namespace-settings passes through as-is, IPM expects to strip %.
do ##class(%IPM.Main).Shell("install vscode-per-namespace-settings")
set ^UnitTestRoot="/usr/irissys/.vscode/%SYS/UnitTestRoot"
5 changes: 4 additions & 1 deletion src/cls/IPM/Main.cls
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,10 @@ ClassMethod GetListModules(pNamespace As %String = {$Namespace}, pSearch As %Str
Quit
}
}
If '$$$comClassDefined("%IPM.Storage.ModuleItem") {
// Don't error in namespaces without IPM enabled
Quit
}
Set tArgs = 0
Set tQuery = "SELECT Name,VersionString,Description,ExternalName,DeveloperMode FROM %IPM_Storage.ModuleItem"
Set pSearch = $ZStrip(pSearch, "<>WC")
Expand Down Expand Up @@ -2973,4 +2977,3 @@ ClassMethod DisplayModules(ByRef pList, pNumbered As %Boolean = 0, pWithNamespac
}

}

6 changes: 4 additions & 2 deletions src/cls/IPM/ResourceProcessor/Default/Document.cls
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ Method OnPhase(pPhase As %String, ByRef pParams, Output pResourceHandled As %Boo
If (##class(%File).DirectoryExists(tResourceCatDirectory)) {
Quit
}
}
Set tResourceDirectory = tResourceCatDirectory
}
If ##class(%File).DirectoryExists(tResourceCatDirectory) {
Set tResourceDirectory = tResourceCatDirectory
}

If tDeveloperMode && (..Extension '= "") && (tName '= "") {
Set ^Sources(..Extension,tName_..#NAMEPOSTFIX) = tSourcesPrefix _ tResourceDirectory
Expand Down

0 comments on commit e5b48e9

Please sign in to comment.