-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #437 from intersystems/v1-jan-2024-updates
Fold all updates since May from master and internal repo into v1
- Loading branch information
Showing
32 changed files
with
473 additions
and
971 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Images List | ||
on: | ||
workflow_call: | ||
outputs: | ||
images: | ||
description: "The full list of images to use, as a JSON array of imagename:tag" | ||
value: ${{ jobs.images.outputs.images }} | ||
main: | ||
description: "The main image to use (earliest relevant version) to generate the installer XML file" | ||
value: ${{ jobs.images.outputs.main }} | ||
|
||
env: | ||
name: | | ||
irishealth-community | ||
iris-community | ||
jobs: | ||
images: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
images: ${{ steps.set-matrix.outputs.images }} | ||
main: ${{ steps.set-matrix.outputs.main }} | ||
steps: | ||
- name: Images list | ||
id: set-matrix | ||
run: | | ||
images="" | ||
for n in $name; do | ||
tags=$(curl -su ":" https://containers.intersystems.com/v2/intersystems/${n}/tags/list | jq -r '.tags[]' | awk '!/(-linux)|([1-4]-preview)/' | awk '!/\.[1-4]\.0\./' | uniq) | ||
for tag in $tags; do images+='"'${n}:${tag}'",'; done | ||
done; | ||
echo images="[${images%?}]" >> $GITHUB_OUTPUT | ||
echo main=${images%%,*} >> $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,110 @@ | ||
name: Test all packages | ||
on: workflow_dispatch | ||
name: Test major packages | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
minVersionCount: | ||
description: "Minimum number of versions a package must have to be tested" | ||
required: true | ||
type: number | ||
default: 10 | ||
|
||
jobs: | ||
job1: | ||
matrix-setup: | ||
runs-on: ubuntu-latest | ||
env: | ||
PM_URL: https://pm.community.intersystems.com/packages/-/all?allVersions=1 | ||
JQ_SCRIPT: reduce .[] as $item ([]; if $item.allVersions | length >= ${{ inputs.minVersionCount }} then . + [$item.name] else . end) | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- id: set-matrix | ||
run: | | ||
matrix=`curl https://pm.community.intersystems.com/packages/-/all | jq '.[].name' | jq -s` | ||
echo "::set-output name=matrix::$matrix" | ||
job2: | ||
needs: job1 | ||
- id: set-matrix | ||
run: | | ||
matrix=$(curl -L "$PM_URL" | jq -cr "$JQ_SCRIPT") | ||
echo "matrix=$matrix" >> $GITHUB_OUTPUT | ||
prepare-image: | ||
timeout-minutes: 20 | ||
runs-on: ubuntu-latest | ||
env: | ||
IMAGE: containers.intersystems.com/intersystems/iris-community:latest-em | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Build Image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: false | ||
load: true | ||
tags: zpm:latest | ||
build-args: Base=${{ env.IMAGE }} | ||
outputs: type=docker,dest=/tmp/zpmimage.tar | ||
- name: Test Image | ||
run: | | ||
docker load -i /tmp/zpmimage.tar | ||
docker image ls | ||
CONTAINER=$(docker run -d --rm -v `pwd`:/home/irisowner/zpm/ zpm) | ||
docker exec $CONTAINER /usr/irissys/dev/Cloud/ICM/waitISC.sh | ||
docker exec -i $CONTAINER iris session IRIS << EOF | ||
zpm "list":1 | ||
zn "%SYS" | ||
zpm "test zpm -v -only":1:1 | ||
EOF | ||
- name: Upload Image | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: zpmimage | ||
path: /tmp/zpmimage.tar | ||
|
||
run-tests: | ||
needs: | ||
- matrix-setup | ||
- prepare-image | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: ${{fromJson(needs.job1.outputs.matrix)}} | ||
fail-fast: false | ||
matrix: | ||
package: ${{ fromJson(needs.matrix-setup.outputs.matrix) }} | ||
steps: | ||
- run: echo test | ||
- uses: actions/checkout@master | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Download Artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: zpmimage | ||
path: /tmp | ||
- name: Load Image | ||
run: | | ||
docker load -i /tmp/zpmimage.tar | ||
docker image ls | ||
- name: Container Setup | ||
id: setup-zpm | ||
timeout-minutes: 15 | ||
run: | | ||
# Don't specify the container name because `act` will run multiple jobs in parallel and cause name conflicts | ||
CONTAINER=$(docker run -d --rm -v `pwd`:/home/irisowner/zpm/ zpm) | ||
echo "CONTAINER=$CONTAINER" >> $GITHUB_OUTPUT | ||
docker exec $CONTAINER /usr/irissys/dev/Cloud/ICM/waitISC.sh | ||
docker exec -i $CONTAINER iris session IRIS << EOF | ||
zpm "repo -r -name registry -url https://pm.community.intersystems.com/":1 | ||
halt | ||
EOF | ||
- name: Test ${{ matrix.package }} | ||
timeout-minutes: 15 | ||
env: | ||
CONTAINER: ${{ steps.setup-zpm.outputs.CONTAINER }} | ||
test-flags: >- | ||
-verbose -DUnitTest.ManagerClass=%UnitTest.Manager -DUnitTest.JUnitOutput=/test-reports/junit.xml | ||
-DUnitTest.FailuresAreFatal=1 -DUnitTest.Manager=%UnitTest.Manager | ||
run: | | ||
docker exec -i ${{ env.CONTAINER }} iris session IRIS << EOF | ||
zpm "install ${{ matrix.package }}":1 | ||
zpm "${{ matrix.package }} test -only ${{ env.test-flags }}":1:1 | ||
EOF | ||
- name: Stop Container | ||
run: | | ||
# To ensure a clean state after using `act` locally | ||
docker stop -t 5 ${{ steps.setup-zpm.outputs.CONTAINER }} | ||
docker ps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"recommendations": [ | ||
"intersystems.language-server", | ||
"intersystems-community.testingmanager", | ||
"intersystems-community.vscode-objectscript", | ||
"ms-azuretools.vscode-docker" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.