-
Notifications
You must be signed in to change notification settings - Fork 4
69 lines (62 loc) · 2.28 KB
/
e2e.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# To run the e2e tests.
# currently setup on dev branch.
name: E2E
on:
workflow_dispatch:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'oracle'
cache: 'gradle'
- name: Setup Gradle 5.6.4
uses: gradle/[email protected]
with:
gradle-version: 5.6.4
- name: Execute Gradle build
run: ./gradlew clean build copyDependencies :server:copyJacocoAgent -x test
- name: Prepare mount directory for Web container - to write code coverage file.
run: chmod a+w server/build/jacoco
- name: Build the Varadhi Docker image
run: docker build . --file setup/docker/Dockerfile --tag varadhi.docker.registry/varadhi:latest --build-arg ENV=test
- name: Setup the environment
run: docker compose --profile test -f setup/docker/compose.yml up -d --wait --wait-timeout 180
- name: Run the test
run: ./gradlew test testE2E
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v2
if: success()
with:
files: |
*/build/test-results/**/TEST*.xml
fail_on: 'test failures'
compare_to_earlier_commit: false
- name: Dump test execution logs
uses: jwalton/gh-docker-logs@v2
with:
images: 'varadhi.docker.registry/varadhi,apachepulsar/pulsar,zookeeper'
- name: Restart the server process to force the code coverage dump
run: docker exec docker-web-1 pkill java
- name: Generate Code Coverage report
run: ./gradlew jacocoTestReport
- name: Publish code coverage (uses CodeCov.io)
uses: codecov/codecov-action@v3
with:
files: |
*/build/reports/jacoco/test/jacocoTestReport.xml
- name: Tear down the docker containers
run: docker compose --profile test -f setup/docker/compose.yml down
- name: Tear down the data volumes
run: docker volume rm $(docker volume ls -q | egrep -E 'zk|pulsar')