Skip to content

Commit ce0ea87

Browse files
author
Janne Rönkkö
committed
Fetch seed data from the same commit from which the used Cypress Docker image was built from
1 parent 0d70fe4 commit ce0ea87

5 files changed

Lines changed: 31 additions & 9 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,14 @@ Parameters:
199199
Example usage:
200200

201201
```
202-
- uses: HSLdevcom/jore4-tools/github-actions/setup-e2e-environment@setup-e2e-environment-v8
202+
- uses: HSLdevcom/jore4-tools/github-actions/setup-e2e-environment@setup-e2e-environment-v9
203203
with:
204204
ui_version: 'docker.registry.example.org/jore4-ui:latest'
205205
```
206206

207207
```
208208
steps:
209-
- uses: HSLdevcom/jore4-tools/github-actions/setup-e2e-environment@setup-e2e-environment-v8
209+
- uses: HSLdevcom/jore4-tools/github-actions/setup-e2e-environment@setup-e2e-environment-v9
210210
with:
211211
custom_docker_compose: ./docker/docker-compose.custom.yml
212212
```
@@ -226,12 +226,12 @@ Example usage:
226226
227227
```
228228
steps:
229-
- uses: HSLdevcom/jore4-tools/github-actions/setup-e2e-environment@setup-e2e-environment-v8
229+
- uses: HSLdevcom/jore4-tools/github-actions/setup-e2e-environment@setup-e2e-environment-v9
230230
- uses: HSLdevcom/jore4-tools/github-actions/run-cypress-tests@run-cypress-tests-v1
231231
```
232232
233233
```
234-
- uses: HSLdevcom/jore4-tools/github-actions/setup-e2e-environment@setup-e2e-environment-v8
234+
- uses: HSLdevcom/jore4-tools/github-actions/setup-e2e-environment@setup-e2e-environment-v9
235235
with:
236236
ui_version: 'docker.registry.example.org/jore4-ui:latest'
237237

github-actions/run-ci/action.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ runs:
111111
using: composite
112112
steps:
113113
- name: Start e2e env
114-
uses: HSLdevcom/jore4-tools/github-actions/setup-e2e-environment@setup-e2e-environment-v8
114+
id: start-e2e-env
115+
uses: HSLdevcom/jore4-tools/github-actions/setup-e2e-environment@setup-e2e-environment-v9
115116
with:
116117
docker_compose_bundle_gha_artifact: "${{ inputs.docker_compose_bundle_gha_artifact }}"
117118
ui_version: "${{ inputs.ui_version }}"
@@ -131,10 +132,14 @@ runs:
131132
start_jore3_importer: "${{ inputs.start_jore3_importer }}"
132133

133134
- name: Seed infrastructure links
134-
uses: HSLdevcom/jore4-tools/github-actions/seed-infrastructure-links@seed-infrastructure-links-v2
135+
uses: HSLdevcom/jore4-tools/github-actions/seed-infrastructure-links@seed-infrastructure-links-v3
136+
with:
137+
seed_data_commit_sha: "${{ steps.start-e2e-env.outputs.e2e_source_commit_sha }}"
135138

136139
- name: Seed municipalities and fare zones
137-
uses: HSLdevcom/jore4-tools/github-actions/seed-municipalities-and-fare-zones@seed-municipalities-and-fare-zones-v1
140+
uses: HSLdevcom/jore4-tools/github-actions/seed-municipalities-and-fare-zones@seed-municipalities-and-fare-zones-v2
141+
with:
142+
seed_data_commit_sha: "${{ steps.start-e2e-env.outputs.e2e_source_commit_sha }}"
138143

139144
- name: Run e2e tests
140145
env:

github-actions/seed-infrastructure-links/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ inputs:
66
description: Database connection string
77
required: false
88
default: "postgresql://dbadmin:adminpassword@localhost:5432/jore4e2e"
9+
seed_data_commit_sha:
10+
description: The commit SHA of jore4-ui repository from which infrastructure links seed data is read from
11+
required: true
912

1013
runs:
1114
using: "composite"
1215
steps:
1316
- name: Fetch infrastructure link dump
1417
shell: bash
1518
run: |
16-
curl https://raw.githubusercontent.com/HSLdevcom/jore4-ui/main/test-db-manager/src/dumps/infraLinks/infraLinks.sql \
19+
curl https://raw.githubusercontent.com/HSLdevcom/jore4-ui/${{ inputs.seed_data_commit_sha }}/test-db-manager/src/dumps/infraLinks/infraLinks.sql \
1720
-o infraLinks.sql
1821
1922
- name: Verify that testdb is up, running and migrated

github-actions/seed-municipalities-and-fare-zones/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ inputs:
55
description: Import endpoint of Tiamat
66
required: false
77
default: "localhost:3010/services/stop_places/netex"
8+
seed_data_commit_sha:
9+
description: The commit SHA of jore4-ui repository from which municipalities and fare zones seed data is read from
10+
required: true
811

912
runs:
1013
using: "composite"
1114
steps:
1215
- name: Fetch netex import file
1316
shell: bash
1417
run: |
15-
curl https://raw.githubusercontent.com/HSLdevcom/jore4-ui/main/netex/hsl-zones-netex.xml \
18+
curl https://raw.githubusercontent.com/HSLdevcom/jore4-ui/${{ inputs.seed_data_commit_sha }}/netex/hsl-zones-netex.xml \
1619
-o hsl-zones-netex.xml
1720
1821
- name: Verify that tiamat is up and wait if needed

github-actions/setup-e2e-environment/action.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ inputs:
9999
required: false
100100
default: "false"
101101

102+
outputs:
103+
e2e_source_commit_sha:
104+
description: The commit SHA from which E2E tests were built from
105+
value: ${{ steps.extract-metadata.outputs.e2e_source_commit_sha }}
106+
102107
runs:
103108
using: "composite"
104109
steps:
@@ -315,3 +320,9 @@ runs:
315320
- name: Verify that all containers are healthy
316321
run: '[ -z "$(docker ps -q --filter health=unhealthy)" ]'
317322
shell: bash
323+
324+
- name: Extract metadata
325+
id: extract-metadata
326+
shell: bash
327+
run: |
328+
echo e2e_source_commit_sha=$(docker inspect cypress -f '{{ .Config.Labels.git_sha }}') >> ${GITHUB_OUTPUT}

0 commit comments

Comments
 (0)