-
Notifications
You must be signed in to change notification settings - Fork 23
69 lines (67 loc) · 2.12 KB
/
main.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
# Workflow for running Unit tests and Integration tests
name: Main Tests
on:
workflow_dispatch:
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the project
uses: actions/checkout@v2
- name: Build the project
run: cd connector && sbt package
- name: Upload the build artifact
uses: actions/upload-artifact@v3
with:
name: build-jar-file
path: /home/runner/work/spark-connector/spark-connector/connector/target/scala-2.12/spark-vertica-connector_2.12-*.jar
run-analysis:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout the project
uses: actions/checkout@v2
- name: Run scalastyle
run: cd connector && sbt scalastyle
run-unit-tests:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout the project
uses: actions/checkout@v2
- name: Run unit tests
run: cd connector && sbt coverage test coverageReport
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v2
with:
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
verbose: true
run-integration-tests:
runs-on: ubuntu-latest
needs: [build]
env:
VERTICA_VERSION: 12.0.3-0
steps:
- name: Checkout the project
uses: actions/checkout@v2
- name: Run docker compose
run: cd docker && docker-compose up -d
- name: Download the build artifact
uses: actions/download-artifact@v2
with:
name: build-jar-file
path: ./functional-tests/lib/
- name: Wait for Vertica to be available
uses: nick-invision/retry@v2
with:
timeout_seconds: 20
max_attempts: 10
retry_on: error
command: docker logs docker_vertica_1 | grep "Vertica container is now running" >/dev/null
- name: Run the integration tests
run: docker exec -w /spark-connector/functional-tests docker_client_1 sbt run
- name: Remove docker containers
run: cd docker && docker-compose down