-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
69 lines (64 loc) · 2.53 KB
/
action.yml
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
name: 'Run TEAM Engine'
description: 'Spins up a TEAM Engine instance inside a docker container'
branding:
icon: 'award'
color: 'blue'
inputs:
test-suite-identifier:
description: 'Identifier of the Executable Test Suite (etscode) to be run. Example: ogcapi-features-1.0'
test-session-arguments:
description: >
Space-separated string with arguments that are to be sent for running the test session. example:
'iut=http://pygeoapi:5000'
teamengine-url:
required: false
description: >
URL for the teamengine instance to use for running the test suite. If not provided, this will spin up a docker
container using the [ogccite/teamengine-production:1.0-SNAPSHOT](https://hub.docker.com/r/ogccite/teamengine-production) image.
If you specify a custom teamengine URL you may also optonally supply authentication credentials by defining
them as secrets - Expected secret names are: `teamengine_username` and `teamengine_password`.
outputs:
results:
description: 'Test results'
value: '${{ steps.run-executable-test-suite.outputs.results }}'
runs:
using: 'composite'
steps:
- name: 'Add action path to the global path'
shell: bash
run: echo "${{ github.action_path }}" >> ${GITHUB_PATH}
- name: 'Set up Python'
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: 'Set up poetry'
uses: Gr1N/setup-poetry@v9
with:
poetry-version: '1.8.3'
- name: 'Set up cache'
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
- name: 'install action code'
shell: 'bash'
run: |
cd ${{ github.action_path }}
poetry install
- name: 'Start TEAM engine'
if: ${{ !inputs.teamengine-url }}
shell: 'bash'
run: >
docker run
--detach
--rm
--name teamengine
--network host
ogccite/teamengine-production:1.0-SNAPSHOT
- name: 'Run executable test suite'
id: 'run-executable-test-suite'
shell: bash
run: |
cd ${{ github.action_path }}
test_result=$(poetry run ogc-cite-action execute-test-suite ${{ inputs.teamengine-url || 'http://localhost:8080/teamengine' }} ${{ inputs.test-suite-identifier }} --teamengine-username=${{ env.teamengine_username || 'ogctest' }} --teamengine-password=${{ env.teamengine_password || 'ogctest' }} ${{ inputs.test-session-arguments }})
echo "${test_result}" >> $GITHUB_STEP_SUMMARY