-
Notifications
You must be signed in to change notification settings - Fork 17
42 lines (42 loc) · 1.52 KB
/
integration-tests.yml
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
# End to end integration tests - GitHub Actions
name: integration tests
on: [push, pull_request]
jobs:
integration-tests:
name: Run integration tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Prepare environment variable
shell: bash
run: |
if [ "$GITHUB_EVENT_NAME" == "push" ]
then
echo $'\nGIT_CLONE_BRANCH=${GITHUB_REF_NAME}' >> ./deployments/docker/default.env
else
echo $'\nGIT_CLONE_BRANCH=${GITHUB_HEAD_REF}' >> ./deployments/docker/default.env
fi
- name: Setup services and integration tests containers
run: make -C integration-tests integration-tests-up
- name: Save test log
run: docker logs -t -f tavern | tee tavern-tests.log &
- name: Archive tavern container log
if: always()
uses: actions/upload-artifact@v3
with:
name: tavern-logs
path: ./tavern-tests.log
- name: Check for failures
run: grep 'FAILURES' tavern-tests.log | python3 scripts/integ-fail.py
- name: Save docker compose logs
if: always()
run: docker-compose --env-file=deployments/docker/default.env --file=integration-tests/docker-compose-integration-tests.yml logs -f -t --no-color | tee container.log &
- name: Archive container logs
if: always()
uses: actions/upload-artifact@v3
with:
name: container-logs
path: ./container.log
- name: Tear down services
run: make -C integration-tests integration-tests-down