Skip to content

Commit 349c43d

Browse files
committed
Move infrastructure link seeding to separate action
1 parent 5dd6140 commit 349c43d

4 files changed

Lines changed: 42 additions & 59 deletions

File tree

.github/workflows/test-run-cypress-tests-action.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ jobs:
1515
uses: actions/checkout@v3
1616

1717
- name: Start e2e env
18-
env:
19-
INFRASTRUCTURE_LINK_DUMP_PATH: infraLinks.sql
2018
uses: ./github-actions/setup-e2e-environment
2119

20+
- name: Seed infrastructure links
21+
uses: ./github-actions/seed-infrastructure-links
22+
2223
- name: Run e2e tests from github action
2324
uses: ./github-actions/run-cypress-tests

.github/workflows/test-setup-e2e-environment-action.yml

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ on:
88
jobs:
99
test-e2e-setup-action:
1010
runs-on: ubuntu-20.04
11-
env:
12-
INFRASTRUCTURE_LINK_DUMP_PATH: infraLinks.sql
1311

1412
strategy:
1513
matrix:
@@ -116,27 +114,5 @@ jobs:
116114
exit 1
117115
fi
118116
119-
- name: Set up PostgreSQL client
120-
run: |
121-
sudo apt-get -yqq install postgresql-client
122-
123-
- name: Fetch infrastructure link dump
124-
run: |
125-
curl https://raw.githubusercontent.com/HSLdevcom/jore4-ui/main/test-db-manager/src/dumps/infraLinks/infraLinks.sql \
126-
-o ${{ env.INFRASTRUCTURE_LINK_DUMP_PATH }}
127-
128-
- name: Seed db1 with infrastructure links
129-
run: |
130-
psql postgresql://dbadmin:adminpassword@localhost:6532/jore4e2e < ${{ env.INFRASTRUCTURE_LINK_DUMP_PATH }}
131-
132-
- name: Seed db2 with infrastructure links
133-
run: |
134-
psql postgresql://dbadmin:adminpassword@localhost:6533/jore4e2e < ${{ env.INFRASTRUCTURE_LINK_DUMP_PATH }}
135-
136-
- name: Seed db3 with infrastructure links
137-
run: |
138-
psql postgresql://dbadmin:adminpassword@localhost:6534/jore4e2e < ${{ env.INFRASTRUCTURE_LINK_DUMP_PATH }}
139-
140-
- name: Seed db4 with infrastructure links
141-
run: |
142-
psql postgresql://dbadmin:adminpassword@localhost:6432/jore4e2e < ${{ env.INFRASTRUCTURE_LINK_DUMP_PATH }}
117+
- name: Seed infrastructure links
118+
uses: ./github-actions/seed-infrastructure-links
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "Seed infrastructure links"
2+
description:
3+
"Seeds infrastructure links needed in e2e tests"
4+
5+
runs:
6+
using: "composite"
7+
steps:
8+
- name: Set up PostgreSQL client
9+
shell: bash
10+
run: |
11+
sudo apt-get -yqq install postgresql-client
12+
13+
- name: Fetch infrastructure link dump
14+
shell: bash
15+
run: |
16+
curl https://raw.githubusercontent.com/HSLdevcom/jore4-ui/main/test-db-manager/src/dumps/infraLinks/infraLinks.sql \
17+
-o infraLinks.sql
18+
19+
- name: Seed db1 with infrastructure links
20+
shell: bash
21+
run: |
22+
psql postgresql://dbadmin:adminpassword@localhost:6532/jore4e2e < infraLinks.sql
23+
24+
- name: Seed db2 with infrastructure links
25+
shell: bash
26+
run: |
27+
psql postgresql://dbadmin:adminpassword@localhost:6533/jore4e2e < infraLinks.sql
28+
29+
- name: Seed db3 with infrastructure links
30+
shell: bash
31+
run: |
32+
psql postgresql://dbadmin:adminpassword@localhost:6534/jore4e2e < infraLinks.sql
33+
34+
- name: Seed db4 with infrastructure links
35+
shell: bash
36+
run: |
37+
psql postgresql://dbadmin:adminpassword@localhost:6432/jore4e2e < infraLinks.sql

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

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -289,34 +289,3 @@ runs:
289289
- name: Verify that all containers are healthy
290290
run: '[ -z "$(docker ps -q --filter health=unhealthy)" ]'
291291
shell: bash
292-
293-
- name: Set up PostgreSQL client
294-
shell: bash
295-
run: |
296-
sudo apt-get -yqq install postgresql-client
297-
298-
- name: Fetch infrastructure link dump
299-
shell: bash
300-
run: |
301-
curl https://raw.githubusercontent.com/HSLdevcom/jore4-ui/main/test-db-manager/src/dumps/infraLinks/infraLinks.sql \
302-
-o ${{ env.INFRASTRUCTURE_LINK_DUMP_PATH }}
303-
304-
- name: Seed db1 with infrastructure links
305-
shell: bash
306-
run: |
307-
psql postgresql://dbadmin:adminpassword@localhost:6532/jore4e2e < ${{ env.INFRASTRUCTURE_LINK_DUMP_PATH }}
308-
309-
- name: Seed db2 with infrastructure links
310-
shell: bash
311-
run: |
312-
psql postgresql://dbadmin:adminpassword@localhost:6533/jore4e2e < ${{ env.INFRASTRUCTURE_LINK_DUMP_PATH }}
313-
314-
- name: Seed db3 with infrastructure links
315-
shell: bash
316-
run: |
317-
psql postgresql://dbadmin:adminpassword@localhost:6534/jore4e2e < ${{ env.INFRASTRUCTURE_LINK_DUMP_PATH }}
318-
319-
- name: Seed db4 with infrastructure links
320-
shell: bash
321-
run: |
322-
psql postgresql://dbadmin:adminpassword@localhost:6432/jore4e2e < ${{ env.INFRASTRUCTURE_LINK_DUMP_PATH }}

0 commit comments

Comments
 (0)