-
Notifications
You must be signed in to change notification settings - Fork 7
112 lines (105 loc) · 3.33 KB
/
Copy pathci.yml
File metadata and controls
112 lines (105 loc) · 3.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: CI
on:
pull_request:
push:
branches: [master]
workflow_dispatch:
permissions:
contents: read
jobs:
unit:
name: Unit tests (Python ${{ matrix.python }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
cache: pip
- run: python -m pip install -e ".[dev]"
- run: python -m pytest src/tests/unit
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.10"
cache: pip
- run: python -m pip install -e ".[dev]"
- run: ruff check src scripts
- run: pyright
- run: mkdocs build --strict
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.10"
cache: pip
- run: python -m pip install -e ".[dev]"
- run: python -m build
- run: python -m twine check dist/*
- run: python scripts/check_wheel_contents.py dist/*.whl
- uses: actions/upload-artifact@v4
with:
name: wheel
path: dist/*.whl
iris:
name: IRIS latest
needs: [unit, quality, package]
runs-on: ubuntu-latest
env:
IMAGE: intersystemsdc/iris-community:latest
steps:
- uses: actions/checkout@v5
- run: docker pull "$IMAGE"
- run: |
docker build --build-arg BASE="$IMAGE" \
--build-arg IRISUSERNAME=${{ secrets.IRIS_USERNAME || 'SuperUser' }} \
--build-arg IRISPASSWORD=${{ secrets.IRIS_PASSWORD || 'SYS' }} \
-t pytest-iris -f dockerfile-ci .
docker run -i --rm pytest-iris
iris-remote:
name: IRIS remote API
needs: [unit, quality, package]
runs-on: ubuntu-latest
env:
IMAGE: intersystemsdc/iris-community:latest
IOP_URL: http://localhost:52773
IOP_USERNAME: ${{ secrets.IRIS_USERNAME || 'SuperUser' }}
IOP_PASSWORD: ${{ secrets.IRIS_PASSWORD || 'SYS' }}
IOP_NAMESPACE: IRISAPP
steps:
- uses: actions/checkout@v5
- run: docker pull "$IMAGE"
- run: |
docker build --build-arg BASE="$IMAGE" \
--build-arg IRISUSERNAME="$IOP_USERNAME" \
--build-arg IRISPASSWORD="$IOP_PASSWORD" \
-t pytest-iris -f dockerfile-ci .
- run: |
docker run -d --name iris-server -p 52773:52773 \
--entrypoint /irisdev/app/iris-start-and-wait.sh pytest-iris
- name: Wait for IRIS REST API
run: |
for i in $(seq 1 60); do
curl -sf -u "$IOP_USERNAME:$IOP_PASSWORD" \
"$IOP_URL/api/iop/version?namespace=$IOP_NAMESPACE" >/dev/null && exit 0
if [ "$i" = 60 ]; then docker logs iris-server; exit 1; fi
sleep 5
done
- name: Run remote tests
run: |
docker exec -e IOP_URL -e IOP_USERNAME -e IOP_PASSWORD -e IOP_NAMESPACE \
-w /irisdev/app iris-server \
python3 -m pytest src/tests/e2e/remote -v
- if: failure()
run: docker logs iris-server
- if: always()
run: docker rm -f iris-server || true