Skip to content

Commit fa660c7

Browse files
committed
Trial using templating
1 parent 3f41bd8 commit fa660c7

5 files changed

Lines changed: 223 additions & 737 deletions

File tree

‎.github/workflows/common.yml‎

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
python-version:
5+
required: false
6+
default: "3.14"
7+
type: string
8+
platform:
9+
required: false
10+
default: ubuntu-latest
11+
type: string
12+
unix_system:
13+
required: false
14+
default: true
15+
type: boolean
16+
shell:
17+
required: false
18+
type: string
19+
default: bash
20+
secrets:
21+
SIMVUE_URL:
22+
required: true
23+
SIMVUE_TOKEN:
24+
required: true
25+
26+
jobs:
27+
object_retrieval:
28+
uses: ./.github/workflows/test_group.yml
29+
with:
30+
python-version: ${{ inputs.python-version }}
31+
platform: ${{ inputs.platform }}
32+
test-group: object_retrieval ${{ startsWith(inputs.platform, 'windows') && 'and not unix' || '' }}
33+
group-label: Object Retrieval
34+
shell: ${{ inputs.shell }}
35+
secrets:
36+
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
37+
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
38+
object_removal:
39+
uses: ./.github/workflows/test_group.yml
40+
with:
41+
python-version: ${{ inputs.python-version }}
42+
platform: ${{ inputs.platform }}
43+
shell: ${{ inputs.shell }}
44+
test-group: object_removal ${{ startsWith(inputs.platform, 'windows') && 'and not unix' || '' }}
45+
group-label: Object Removal
46+
secrets:
47+
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
48+
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
49+
dispatch_tests:
50+
uses: ./.github/workflows/test_group.yml
51+
with:
52+
python-version: ${{ inputs.python-version }}
53+
shell: ${{ inputs.shell }}
54+
platform: ${{ inputs.platform }}
55+
test-group: dispatch ${{ startsWith(inputs.platform, 'windows') && 'and not unix' || '' }}
56+
group-label: Dispatch
57+
secrets:
58+
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
59+
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
60+
run_tests_online:
61+
uses: ./.github/workflows/test_group.yml
62+
with:
63+
python-version: ${{ inputs.python-version }}
64+
shell: ${{ inputs.shell }}
65+
platform: ${{ inputs.platform }}
66+
test-group: online and not api ${{ startsWith(inputs.platform, 'windows') && 'and not unix' || '' }}
67+
group-label: Run Tests (Online)
68+
secrets:
69+
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
70+
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
71+
run_tests_offline:
72+
uses: ./.github/workflows/test_group.yml
73+
with:
74+
python-version: ${{ inputs.python-version }}
75+
shell: ${{ inputs.shell }}
76+
platform: ${{ inputs.platform }}
77+
test-group: (offline and not api ${{ startsWith(inputs.platform, 'windows') && 'and not unix' || '' }} or cli
78+
group-label: Run Tests (Offline)
79+
secrets:
80+
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
81+
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
82+
config_tests:
83+
uses: ./.github/workflows/test_group.yml
84+
with:
85+
python-version: ${{ inputs.python-version }}
86+
shell: ${{ inputs.shell }}
87+
platform: ${{ inputs.platform }}
88+
test-group: config ${{ startsWith(inputs.platform, 'windows') && 'and not unix' || '' }}
89+
group-label: Configuration
90+
secrets:
91+
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
92+
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
93+
scenario_tests:
94+
uses: ./.github/workflows/test_group.yml
95+
with:
96+
python-version: ${{ inputs.python-version }}
97+
shell: ${{ inputs.shell }}
98+
platform: ${{ inputs.platform }}
99+
test-group: scenario and not run
100+
group-label: Scenarios ${{ startsWith(inputs.platform, 'windows') && 'and not unix' || '' }}
101+
secrets:
102+
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
103+
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
104+
executor_tests:
105+
uses: ./.github/workflows/test_group.yml
106+
with:
107+
python-version: ${{ inputs.python-version }}
108+
shell: ${{ inputs.shell }}
109+
platform: ${{ inputs.platform }}
110+
test-group: executor ${{ startsWith(inputs.platform, 'windows') && 'and not unix' || '' }}
111+
group-label: Executor
112+
secrets:
113+
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
114+
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
115+
api_tests:
116+
uses: ./.github/workflows/test_group.yml
117+
with:
118+
python-version: ${{ inputs.python-version }}
119+
shell: ${{ inputs.shell }}
120+
platform: ${{ inputs.platform }}
121+
test-group: api ${{ startsWith(inputs.platform, 'windows') && 'and not unix' || '' }}
122+
group-label: Low Level API
123+
secrets:
124+
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
125+
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
126+
local_tests:
127+
uses: ./.github/workflows/test_group.yml
128+
with:
129+
python-version: ${{ inputs.python-version }}
130+
shell: ${{ inputs.shell }}
131+
platform: ${{ inputs.platform }}
132+
test-group: local ${{ startsWith(inputs.platform, 'windows') && 'and not unix' || '' }}
133+
group-label: Local
134+
secrets: inherit
Lines changed: 8 additions & 238 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will install Python dependencies, run tests and lint with a single version of Python
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: Simvue Client (Ubuntu)
4+
name: Simvue Python API (Ubuntu)
55

66
on:
77
push:
@@ -10,245 +10,15 @@ on:
1010
branches: ["main", "dev", "hotfix/update-ci"]
1111
workflow_dispatch:
1212

13-
permissions:
14-
contents: read
15-
1613
concurrency:
1714
group: ${{ github.workflow }}-${{ github.ref }}
1815
cancel-in-progress: true
1916

2017
jobs:
21-
object_retrieval:
22-
runs-on: ubuntu-latest
23-
timeout-minutes: 30
24-
steps:
25-
- uses: actions/checkout@v7
26-
- name: Set up Python 3.14
27-
uses: actions/setup-python@v7
28-
with:
29-
python-version: "3.14"
30-
- name: Install dependencies
31-
run: |
32-
python -m pip install poetry
33-
poetry self add poetry-plugin-export
34-
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
35-
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu || true
36-
python -m pip install -r requirements.txt
37-
python -m pip install .
38-
- name: Test with pytest
39-
env:
40-
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
41-
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
42-
run: >-
43-
python -m pytest -x -m object_retrieval -c /dev/null -p no:warnings -n
44-
8 -v -o cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
45-
object_removal:
46-
runs-on: ubuntu-latest
47-
timeout-minutes: 30
48-
steps:
49-
- uses: actions/checkout@v7
50-
- name: Set up Python 3.14
51-
uses: actions/setup-python@v7
52-
with:
53-
python-version: "3.14"
54-
- name: Install dependencies
55-
run: |
56-
python -m pip install poetry
57-
poetry self add poetry-plugin-export
58-
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
59-
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu || true
60-
python -m pip install -r requirements.txt
61-
python -m pip install .
62-
- name: Test with pytest
63-
env:
64-
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
65-
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
66-
run: >-
67-
python -m pytest -x -m object_removal -c /dev/null -p no:warnings -n 8
68-
-v -o cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
69-
dispatch_tests:
70-
runs-on: ubuntu-latest
71-
timeout-minutes: 30
72-
steps:
73-
- uses: actions/checkout@v7
74-
- name: Set up Python 3.14
75-
uses: actions/setup-python@v7
76-
with:
77-
python-version: "3.14"
78-
- name: Install dependencies
79-
run: |
80-
python -m pip install poetry
81-
poetry self add poetry-plugin-export
82-
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
83-
python -m pip install -r requirements.txt
84-
python -m pip install .
85-
- name: Test with pytest
86-
env:
87-
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
88-
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
89-
run: >-
90-
python -m pytest -x -m dispatch -c /dev/null -p no:warnings -n 8 -v -o
91-
cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
92-
run_tests_online:
93-
runs-on: ubuntu-latest
94-
timeout-minutes: 30
95-
steps:
96-
- uses: actions/checkout@v7
97-
- name: Set up Python 3.14
98-
uses: actions/setup-python@v7
99-
with:
100-
python-version: "3.14"
101-
- name: Install dependencies
102-
run: |
103-
python -m pip install poetry
104-
poetry self add poetry-plugin-export
105-
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
106-
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu || true
107-
python -m pip install -r requirements.txt
108-
python -m pip install .
109-
- name: Test with pytest
110-
env:
111-
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
112-
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
113-
run: >-
114-
python -m pytest -x -m "online and not api" -c /dev/null -p
115-
no:warnings -n 8 -v -o cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
116-
run_tests_offline:
117-
runs-on: ubuntu-latest
118-
timeout-minutes: 30
119-
steps:
120-
- uses: actions/checkout@v7
121-
- name: Set up Python 3.14
122-
uses: actions/setup-python@v7
123-
with:
124-
python-version: "3.14"
125-
- name: Install dependencies
126-
run: |
127-
python -m pip install poetry
128-
poetry self add poetry-plugin-export
129-
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
130-
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu || true
131-
python -m pip install -r requirements.txt
132-
python -m pip install .
133-
- name: Test with pytest
134-
env:
135-
SIMVUE_URL: "${{ secrets.SIMVUE_URL }}"
136-
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
137-
run: >-
138-
python -m pytest -x -m "(offline and not api) or cli" -c /dev/null -p
139-
no:warnings -n 0 -v -o cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
140-
config_tests:
141-
runs-on: ubuntu-latest
142-
timeout-minutes: 30
143-
steps:
144-
- uses: actions/checkout@v7
145-
- name: Set up Python 3.14
146-
uses: actions/setup-python@v7
147-
with:
148-
python-version: "3.14"
149-
- name: Install dependencies
150-
run: |
151-
python -m pip install poetry
152-
poetry self add poetry-plugin-export
153-
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
154-
python -m pip install -r requirements.txt
155-
python -m pip install .
156-
- name: Test with pytest
157-
env:
158-
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
159-
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
160-
run: >-
161-
python -m pytest -x -m config -c /dev/null -p no:warnings -n 8 -v -o
162-
cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
163-
scenario_tests:
164-
runs-on: ubuntu-latest
165-
timeout-minutes: 30
166-
steps:
167-
- uses: actions/checkout@v7
168-
- name: Set up Python 3.14
169-
uses: actions/setup-python@v7
170-
with:
171-
python-version: "3.14"
172-
- name: Install dependencies
173-
run: |
174-
python -m pip install poetry
175-
poetry self add poetry-plugin-export
176-
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
177-
python -m pip install -r requirements.txt
178-
python -m pip install .
179-
- name: Test with pytest
180-
env:
181-
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
182-
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
183-
run: >-
184-
python -m pytest -x -m "scenario and not run" -c /dev/null -p
185-
no:warnings -n 0 -v -o cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
186-
executor_tests:
187-
runs-on: ubuntu-latest
188-
timeout-minutes: 30
189-
steps:
190-
- uses: actions/checkout@v7
191-
- name: Set up Python 3.14
192-
uses: actions/setup-python@v7
193-
with:
194-
python-version: "3.14"
195-
- name: Install dependencies
196-
run: |
197-
python -m pip install poetry
198-
poetry self add poetry-plugin-export
199-
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
200-
python -m pip install -r requirements.txt
201-
python -m pip install .
202-
- name: Test with pytest
203-
env:
204-
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
205-
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
206-
run: >-
207-
python -m pytest -x -m executor -c /dev/null -p no:warnings -n 0 -v -o
208-
cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
209-
api_tests:
210-
runs-on: ubuntu-latest
211-
timeout-minutes: 30
212-
steps:
213-
- uses: actions/checkout@v7
214-
- name: Set up Python 3.14
215-
uses: actions/setup-python@v7
216-
with:
217-
python-version: "3.14"
218-
- name: Install dependencies
219-
run: |
220-
python -m pip install poetry
221-
poetry self add poetry-plugin-export
222-
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
223-
python -m pip install -r requirements.txt
224-
python -m pip install .
225-
- name: Test with pytest
226-
env:
227-
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
228-
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
229-
run: >-
230-
python -m pytest -x -m api -c /dev/null -p no:warnings -n 0 -v -o
231-
cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
232-
local_tests:
233-
runs-on: ubuntu-latest
234-
timeout-minutes: 30
235-
steps:
236-
- uses: actions/checkout@v7
237-
- name: Set up Python 3.14
238-
uses: actions/setup-python@v7
239-
with:
240-
python-version: "3.14"
241-
- name: Install dependencies
242-
run: |
243-
python -m pip install poetry
244-
poetry self add poetry-plugin-export
245-
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
246-
python -m pip install -r requirements.txt
247-
python -m pip install .
248-
- name: Test with pytest
249-
env:
250-
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
251-
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
252-
run: >-
253-
python -m pytest -x -m local -c /dev/null -p no:warnings -n 8 -v -o
254-
cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
18+
test_suite:
19+
name: Test Suite
20+
uses: ./.github/workflows/common.yml
21+
with:
22+
platform: ubuntu-latest
23+
python-version: "3.14"
24+
secrets: inherit

0 commit comments

Comments
 (0)