-
Notifications
You must be signed in to change notification settings - Fork 354
181 lines (161 loc) · 5.73 KB
/
continuous-integration.yaml
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: Continuous Integration
on:
pull_request:
paths-ignore:
- '**/README.md'
push:
branches:
- 'release/**'
- 'hotfix/**'
- develop
- master
jobs:
check-all-modules-are-tested:
name: Check all modules are tested
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check all modules are tested
run: ./cd/check_modules.sh
check-copyright:
name: Check Copyright Headers
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'
- name: Run Spotless copyright check
run: mvn -ntp spotless:check -T0.5C
check-markdown-links:
name: Check Markdown Links
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Run linkspector
uses: umbrelladocs/action-linkspector@v1
with:
filter_mode: nofilter
reporter: github-pr-annotations
fail_on_error: true
build-javadoc:
name: Build Javadoc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.m2/repository
!~/.m2/repository/uk
key: all-gaffer-dependencies
restore-keys: Accumulo-gaffer-dependencies
- name: Build Javadoc
run: |
mvn -ntp clean install -Pquick -Dskip.jar-with-dependencies=true -Dshaded.jar.phase=true
mvn -ntp javadoc:javadoc -Pquick
build-and-run-tests:
name: Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
# The below line does the following, check if the branch name contains the words 'windows' or 'release'.
# If these words are present it runs the tests on Windows AND Ubuntu. If the words aren't present it runs the tests on Ubuntu ONLY
# The 'release' keyword is currently disabled. Change 'release-disabled-for-now' to 'release' once the tests have been fixed to reenable this.
os: ${{ fromJSON( (contains( github.head_ref, 'windows') || contains( github.head_ref, 'release-disabled-for-now')) && '["ubuntu-latest", "windows-latest"]' || '["ubuntu-latest"]' ) }}
modules:
- name: Core
values: :gaffer2,:core,:access,:cache,:common-util,:data,:exception,:graph,:operation,:serialisation,:store,:type
- name: Accumulo
values: :accumulo-store,:accumulo-rest
- name: Federated-And-Map
values: :integration-test,:federated-store,:map-store,:map-rest,:simple-federated-store
- name: REST
values: :rest-api,:common-rest,:spring-rest,:core-rest,:store-implementation,:proxy-store
- name: Examples
values: :example,:basic,:basic-model,:basic-rest,:road-traffic,:road-traffic-model,:road-traffic-generators,:road-traffic-rest,:road-traffic-demo,:federated-demo
- name: Big-Data-Libraries
values: :flink-library,:hdfs-library,:spark,:spark-library,:spark-accumulo-library
- name: Time-Library
values: :library,:time-library
- name: Caches
values: :cache-library,:sketches-library,:bitmap-library,:hazelcast-cache-service,:jcs-cache-service
- name: Tinkerpop
values: :tinkerpop
exclude:
- os: windows-latest
modules:
name: Accumulo
- os: windows-latest
modules:
name: Federated-And-Map
- os: windows-latest
modules:
name: Examples
- os: windows-latest
modules:
name: Big-Data-Libraries
- os: windows-latest
modules:
name: Rest
env:
MAVEN_OPTS: -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.m2/repository
!~/.m2/repository/uk
key: ${{matrix.modules.name}}-gaffer-dependencies
restore-keys: ${{matrix.modules.name}}
- name: Install
run: mvn -B -ntp clean install -P quick -pl ${{matrix.modules.values}} -am
- name: Test
run: mvn -B -ntp verify -P coverage -pl ${{matrix.modules.values}}
- name: Add JaCoCo reports to artifact
uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest'
with:
name: jacoco-coverage-${{matrix.modules.name}}
path: "*/**/jacoco.xml"
retention-days: 5
upload-test-coverage:
name: Upload coverage to Codecov
runs-on: ubuntu-latest
needs:
- build-and-run-tests
steps:
- uses: actions/checkout@v4 # Codecov need to see the src code to pair with coverage
- name: Fetch JaCoCo reports artifact
uses: actions/download-artifact@v4
with:
pattern: jacoco-coverage-*
merge-multiple: true
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
name: gaffer-coverage
fail_ci_if_error: true # Ensures upload doesn't fail silently
token: ${{ secrets.CODECOV_TOKEN }}