-
Notifications
You must be signed in to change notification settings - Fork 2
145 lines (121 loc) · 4.37 KB
/
tests.yml
File metadata and controls
145 lines (121 loc) · 4.37 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
TARANTOOL_REGISTRY: "registry.ps.tarantool.io/"
TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX: "registry.ps.tarantool.io/"
jobs:
tests-cartridge-container:
if: "!contains(github.event.head_commit.message, '[maven-release-plugin]')"
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- name: Set up JDK 1.8
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
- name: Docker login to private registry
run: docker login "$TARANTOOL_REGISTRY" -u admin -p "${{ secrets.TARANTOOL_REGISTRY_PASSWORD }}"
- name: Build
run: ./mvnw -B clean package --file pom.xml
- name: Run unit tests
run: ./mvnw -B test -P unit -Djacoco.destFile=target/jacoco-cartridge-container.exec --file pom.xml
- name: Run integration tests
env:
TARANTOOL_SERVER_USER: root
TARANTOOL_SERVER_GROUP: root
TARANTOOL_VERSION: "2.11.8-ubuntu20.04"
run: ./mvnw -B test -P integration -Djacoco.destFile=target/jacoco-cartridge-container.exec --file pom.xml
- name: Print system images
run: docker images
- name: Upload jacoco exec results
uses: actions/upload-artifact@v4
with:
name: tests-cartridge-container-jacoco
path: "**/jacoco-cartridge-container.exec"
retention-days: 5
overwrite: true
tests-tarantool-container:
if: "!contains(github.event.head_commit.message, '[maven-release-plugin]')"
runs-on: ubuntu-latest
timeout-minutes: 25
strategy:
matrix:
tarantool-version: [ "1.x-centos7", "2.11.8-ubuntu20.04", "3.0.1-old" ]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up JDK 1.8
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
- name: Docker login to private registry
run: docker login "$TARANTOOL_REGISTRY" -u admin -p "${{ secrets.TARANTOOL_REGISTRY_PASSWORD }}"
- name: Build and run integration matrix tests
env:
TARANTOOL_VERSION: ${{ matrix.tarantool-version }}
TARANTOOL_SERVER_USER: root
TARANTOOL_SERVER_GROUP: root
run: ./mvnw -B test -P tarantool-container -Djacoco.destFile=target/jacoco-tarantool-container.exec --file pom.xml
- name: Print system images
run: docker images
- name: Upload jacoco exec results
uses: actions/upload-artifact@v4
with:
name: tests-tarantool-container-jacoco
path: "**/jacoco-tarantool-container.exec"
retention-days: 5
overwrite: true
merge-jacoco-report:
if: "!contains(github.event.head_commit.message, '[maven-release-plugin]')"
name: Jacoco Merge Results
needs:
- tests-cartridge-container
- tests-tarantool-container
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 1.8
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
- uses: actions/download-artifact@v4
with:
name: tests-cartridge-container-jacoco
path: .
- uses: actions/download-artifact@v4
with:
name: tests-tarantool-container-jacoco
path: .
- name: merge results
run: |
./mvnw package jacoco:merge jacoco:report -DskipTests -Darguments=-DskipTests
- name: Upload jacoco coverage despite the check result
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: coverage-results-report
path: target/site/jacoco
if-no-files-found: error
overwrite: true
- name: Jacoco Report to PR
id: jacoco
uses: madrapps/jacoco-report@v1.6.1
with:
paths: target/site/jacoco/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 40
min-coverage-changed-files: 60
update-comment: true