Skip to content

Commit 00b7c46

Browse files
zagganasdiwis
andauthored
Added curl test for PR and before building (#245)
* Added test to workflow Co-authored-by: DIWIS <[email protected]>
1 parent be27c67 commit 00b7c46

File tree

3 files changed

+53
-2
lines changed

3 files changed

+53
-2
lines changed

.github/workflows/docker-image.yml

+18-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,29 @@ name: Docker Image CI
33
on:
44
push:
55
branches: [ dev ]
6-
pull_request:
7-
branches: [ dev ]
86

97
env:
108
DOCKER_REPO_NAME: elixircloud/cwl-wes
119

1210
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v2
19+
- name: Test build
20+
run: docker-compose up -d
21+
- name: Sleep
22+
shell: bash
23+
run: sleep 30;
24+
- name: Test endpoint
25+
shell: bash
26+
run: bash test-http-call.bash
27+
- name: End test
28+
run: docker-compose down
1329

1430
build:
1531

.github/workflows/pr-test.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Test
2+
3+
# This workflow uses actions that are not certified by GitHub.
4+
# They are provided by a third-party and are governed by
5+
# separate terms of service, privacy policy, and support
6+
# documentation.
7+
8+
on:
9+
pull_request:
10+
branches: [ dev ]
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v2
21+
- name: Test build
22+
run: docker-compose up -d
23+
- name: Sleep
24+
shell: bash
25+
run: sleep 30;
26+
- name: Test endpoint
27+
shell: bash
28+
run: bash test-http-call.bash
29+
- name: End test
30+
run: docker-compose down

test-http-call.bash

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CODE=$(curl --write-out '%{http_code}' --output /dev/null --silent localhost:8080/ga4gh/wes/v1/runs)
2+
if [ $CODE != "200" ]
3+
then
4+
exit 1;
5+
fi

0 commit comments

Comments
 (0)