Skip to content

Commit 29864ac

Browse files
committed
PROCESS: Installing and launching the application should be reusable among workflows.
1 parent a52a054 commit 29864ac

2 files changed

Lines changed: 41 additions & 24 deletions

File tree

.github/actions/launch/action.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Launch Hyperglosae
2+
description: Install and launch both backend and frontend (sources should be checked out).
3+
4+
inputs:
5+
repo-token:
6+
description: GH token to access frontend build
7+
required: true
8+
9+
runs:
10+
using: composite
11+
steps :
12+
- name: Download, install and launch backend with test data
13+
run: |
14+
export COUCHDB_USER="TO_BE_CHANGED"
15+
export COUCHDB_PASSWORD="TO_BE_CHANGED"
16+
docker compose --file docker-compose.test.yml up --detach updated_samples updated_code
17+
shell: bash
18+
- name: Wait for frontend build
19+
uses: lewagon/wait-on-check-action@v1.3.1
20+
with:
21+
check-regexp: .? / build
22+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
23+
repo-token: ${{ inputs.repo-token }}
24+
- name: Get frontend build
25+
uses: actions/download-artifact@v4
26+
with:
27+
name: frontend-build
28+
path: frontend/build
29+
- name: Start frontend
30+
run: |
31+
export COUCHDB_USER="TO_BE_CHANGED"
32+
export COUCHDB_PASSWORD="TO_BE_CHANGED"
33+
docker compose --file docker-compose.test.yml up --detach
34+
shell: bash
35+
- name: Wait for frontend
36+
uses: docker://benel/wait-for-response:1
37+
with:
38+
args: http://localhost/ 200 30000 500
39+

.github/workflows/tests.yml

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,12 @@ jobs:
1919
fetch-depth: 0 # Greenframe needs the whole history
2020
- name: Download tools
2121
run: |
22-
docker compose --file docker-compose.test.yml pull
2322
curl https://assets.greenframe.io/install.sh | bash
2423
cd frontend; npm install --save-dev @badeball/cypress-cucumber-preprocessor
25-
- name: Install and launch backend with test data
26-
run: |
27-
export COUCHDB_USER="TO_BE_CHANGED"
28-
export COUCHDB_PASSWORD="TO_BE_CHANGED"
29-
docker compose --file docker-compose.test.yml up --detach updated_samples updated_code
30-
- name: Wait for frontend build
31-
uses: lewagon/wait-on-check-action@v1.3.1
24+
- name: Install and launch application
25+
uses: ./.github/actions/launch
3226
with:
33-
check-regexp: .? / build
34-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
3527
repo-token: ${{ secrets.GITHUB_TOKEN }}
36-
- name: Get frontend build
37-
uses: actions/download-artifact@v4
38-
with:
39-
name: frontend-build
40-
path: frontend/build
41-
- name: Start frontend
42-
run: |
43-
export COUCHDB_USER="TO_BE_CHANGED"
44-
export COUCHDB_PASSWORD="TO_BE_CHANGED"
45-
docker compose --file docker-compose.test.yml up --detach
46-
- name: Wait for frontend
47-
uses: docker://benel/wait-for-response:1
48-
with:
49-
args: http://localhost/ 200 30000 500
5028
- name: Run tests
5129
run: |
5230
cd frontend; npx cypress run --config baseUrl=http://localhost

0 commit comments

Comments
 (0)