Skip to content

Commit 23dbfa6

Browse files
committed
Action for setting up test env and running tests
1 parent df8b11b commit 23dbfa6

1 file changed

Lines changed: 149 additions & 0 deletions

File tree

github-actions/run-ci/action.yml

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
name: "Run CI workflow"
2+
description: "Setup the e2e environment and run cypress tests in it"
3+
inputs:
4+
bundle_version:
5+
description: Version of the docker-compose bundle to use (= github release version)
6+
required: false
7+
default: "e2e-docker-compose"
8+
bundle_repo:
9+
description: Repository to retrieve the bundle from
10+
required: false
11+
default: "HSLdevcom/jore4-tools"
12+
ui_version:
13+
description:
14+
Version of ui to use (docker image tag). Set to "" if using the default
15+
version.
16+
required: false
17+
default: ""
18+
hasura_version:
19+
description:
20+
Version of hasura to use (docker image tag). Set to "" if using the
21+
default version.
22+
required: false
23+
default: ""
24+
auth_version:
25+
description:
26+
Version of auth to use (docker image tag). Set to "" if using the default
27+
version.
28+
required: false
29+
default: ""
30+
mbtiles_version:
31+
description:
32+
Version of mbtiles server to use (docker image tag). Set to "" if using
33+
the default version.
34+
required: false
35+
default: ""
36+
jore3importer_version:
37+
description:
38+
Version of jore3importer to use (docker image tag). Set to "" if using the
39+
default version.
40+
required: false
41+
default: ""
42+
testdb_version:
43+
description:
44+
Version of testdb to use (docker image tag). Set to "" if using the
45+
default version.
46+
required: false
47+
default: ""
48+
mssqltestdb_version:
49+
description:
50+
Version of mssqltestdb to use (docker image tag). Set to "" if using the
51+
default version.
52+
required: false
53+
default: ""
54+
mapmatching_version:
55+
description:
56+
Version of map matching service to use (docker image tag). Set to "" if
57+
using the default version.
58+
required: false
59+
default: ""
60+
mapmatchingdb_version:
61+
description:
62+
Version of map matching database to use (docker image tag). Set to "" if
63+
using the default version.
64+
required: false
65+
default: ""
66+
cypress_version:
67+
description:
68+
Version of cypress tests to use (docker image tag). Set to "" if using the
69+
default version.
70+
required: false
71+
default: ""
72+
hastus_version:
73+
description:
74+
Version of hastus importer to use (docker image tag). Set to "" if using
75+
the default version.
76+
required: false
77+
default: ""
78+
timetablesapi_version:
79+
description:
80+
Version of timetables api to use (docker image tag). Set to "" if using
81+
the default version.
82+
required: false
83+
default: ""
84+
tiamat_version:
85+
description: Version of tiamat to use (docker image tag). Set to "" if using
86+
the default version.
87+
required: false
88+
default: ""
89+
custom_docker_compose:
90+
description:
91+
Path for an additional docker-compose file to be used when starting up the
92+
environment. Can be used to e.g. run tests with the repository's own
93+
docker-compose.custom.yml setup
94+
required: false
95+
default: ""
96+
test-tags:
97+
description:
98+
Specify a string of tags for tests to be run in format '@smoke'. To
99+
specify multiple tags, use format '@routes @smoke'. To run all tests, set
100+
it to ''.
101+
required: false
102+
default: "@smoke"
103+
cypress_tests_kept_in_memory:
104+
description: Environment setting to set for running cypress tests.
105+
required: false
106+
default: 5
107+
runs:
108+
using: composite
109+
steps:
110+
- name: Checkout code
111+
uses: actions/checkout@v4
112+
with:
113+
submodules: recursive
114+
115+
- name: Extract metadata to env variables
116+
uses: HSLdevcom/jore4-tools/github-actions/extract-metadata@extract-metadata-v1
117+
118+
- name: Start e2e env
119+
uses: HSLdevcom/jore4-tools/github-actions/setup-e2e-environment@setup-e2e-environment-v5
120+
with:
121+
ui_version: "${{ inputs.ui_version }}"
122+
cypress_version: "${{ inputs.cypress_version }}"
123+
bundle_version: "${{ inputs.bundle_version }}"
124+
bundle_repo: "${{ inputs.bundle_repo }}"
125+
hasura_version: "${{ inputs.hasura_version }}"
126+
auth_version: "${{ inputs.auth_version }}"
127+
mbtiles_version: "${{ inputs.mbtiles_version }}"
128+
jore3importer_version: "${{ inputs.jore3importer_version }}"
129+
testdb_version: "${{ inputs.testdb_version }}"
130+
mssqltestdb_version: "${{ inputs.mssqltestdb_version }}"
131+
mapmatching_version: "${{ inputs.mapmatching_version }}"
132+
mapmatchingdb_version: "${{ inputs.mapmatchingdb_version }}"
133+
hastus_version: "${{ inputs.hastus_version }}"
134+
timetablesapi_version: "${{ inputs.timetablesapi_version }}"
135+
tiamat_version: "${{ inputs.tiamat_version }}"
136+
custom_docker_compose: "${{ inputs.custom_docker_compose }}"
137+
138+
- name: Seed infrastructure links
139+
uses: HSLdevcom/jore4-tools/github-actions/seed-infrastructure-links@seed-infrastructure-links-v2
140+
141+
- name: Seed municipalities and fare zones
142+
uses: HSLdevcom/jore4-tools/github-actions/seed-municipalities-and-fare-zones@seed-municipalities-and-fare-zones-v1
143+
144+
- name: Run e2e tests
145+
env:
146+
CYPRESS_TESTS_KEPT_IN_MEMORY: "${{ inputs.cypress_tests_kept_in_memory }}"
147+
uses: HSLdevcom/jore4-tools/github-actions/run-cypress-tests@run-cypress-tests-v1
148+
with:
149+
test-tags: "${{ inputs.test-tags }}"

0 commit comments

Comments
 (0)