Skip to content

Commit f910bdf

Browse files
committed
update ci
1 parent bbdfb8f commit f910bdf

File tree

2 files changed

+61
-3
lines changed

2 files changed

+61
-3
lines changed

.github/workflows/python-publish.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,33 @@ on:
1515
branches: [main]
1616

1717
jobs:
18-
deploy:
19-
18+
test:
19+
strategy:
20+
matrix:
21+
image:
22+
- intersystemsdc/iris-community:latest
23+
- intersystemsdc/iris-community:preview
2024
runs-on: ubuntu-latest
25+
env:
26+
IMAGE: ${{ matrix.image }}
27+
steps:
28+
- uses: actions/checkout@v3
29+
- run: docker pull $IMAGE
30+
- name: Run Tests
31+
env:
32+
FOLDER: /home/irisowner/sqlalchemy-iris
33+
run: |
34+
docker run -i --rm -v `pwd`:$FOLDER -w $FOLDER --entrypoint $FOLDER/test-in-docker.sh $IMAGE
2135
36+
deploy:
37+
needs: test
38+
runs-on: ubuntu-latest
2239
steps:
2340
- uses: actions/checkout@v3
2441
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
2542
if: github.event_name == 'push'
2643
- name: Set up Python
27-
uses: actions/setup-python@v3
44+
uses: actions/setup-python@v4
2845
with:
2946
python-version: '3.x'
3047
- name: Install dependencies

test-in-docker.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
3+
iris_start () {
4+
iris start iris
5+
6+
# Reset Password changing and activate %Service_CallIn for Embedded Python
7+
cat <<EOF | iris session iris -U %SYS
8+
do ##class(Security.Users).UnExpireUserPasswords("*")
9+
set prop("Enabled")=1
10+
Do ##class(Security.Services).Modify("%Service_CallIn",.prop)
11+
halt
12+
EOF
13+
}
14+
15+
iris_stop () {
16+
echo "Stopping IRIS"
17+
iris stop iris quietly
18+
}
19+
20+
exit_on_error () {
21+
exit=$?;
22+
if [ $exit -ne 0 ]; then
23+
iris_stop
24+
exit $exit
25+
fi
26+
}
27+
28+
iris_start
29+
30+
/usr/irissys/bin/irispython -m pip install -r requirements-dev.txt -r requirements-iris.txt --target /usr/irissys/mgr/python
31+
exit_on_error
32+
33+
# Test in Network mode
34+
/usr/irissys/bin/irispython -m pytest
35+
exit_on_error
36+
37+
# Test in Embedded mode
38+
/usr/irissys/bin/irispython -m pytest --db irisemb
39+
exit_on_error
40+
41+
iris_stop

0 commit comments

Comments
 (0)