forked from Profirator/api-umbrella
-
Notifications
You must be signed in to change notification settings - Fork 6
52 lines (40 loc) · 1.6 KB
/
Copy pathtest.yml
File metadata and controls
52 lines (40 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Run tests
on:
push:
env:
BASE_IMAGE_NAME: fiware/api-umbrella-base
TEST_IMAGE_NAME: api-umbrella-test
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Wait for base image
run: |
./docker/wait-for.sh ${{ env.BASE_IMAGE_NAME }}:${{ steps.extract_branch.outputs.branch }} 15
- name: Build test image
run: |
docker build -f Dockerfile-test -t ${{ env.TEST_IMAGE_NAME }} --build-arg BASE_IMAGE=${{ env.BASE_IMAGE_NAME }}:${{ steps.extract_branch.outputs.branch }} .
- name: Setup test env
run: |
docker-compose -f docker/compose/docker-compose.yaml up -d
# we need to use the host network, since some of the tests change the dns configuration of the container, thus destroy the connection through
# the docker network
- name: Run tests
continue-on-error: true
run: |
docker run -v /test/reports:/app/test/reports -v /test/images:/app/test/tmp/capybara --network host ${{ env.TEST_IMAGE_NAME }} make test
- name: Publish Test Report
uses: mikepenz/action-junit-report@v2
if: always() # always run even if the previous step fails
with:
report_paths: '/test/reports/*.xml'
- uses: actions/upload-artifact@v2
if: always() # always run even if the previous step fails
with:
name: selenium-images
path: /test/images