-
-
Notifications
You must be signed in to change notification settings - Fork 352
246 lines (227 loc) · 9.22 KB
/
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
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# Workflow for testing Spoon.
#
# Note that actions are specified by commit hash. This is to avoid the security
# risk of someone injecting malicious code into a release and then simply
# changing a tag.
name: tests
on:
pull_request:
branches:
- master
push:
branches:
- master
schedule:
- cron: "0 0 * * *"
env:
JAVA_DISTRIBUTION: temurin
MAVEN_OPTS: >-
-Dmaven.resolver.transport=native
-Daether.connector.connectTimeout=300000
-Daether.connector.requestTimeout=300000
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [11, 17, 20, 21-ea]
os: [ubuntu-latest, windows-latest]
exclude:
- os: windows-latest
java: 17
- os: windows-latest
java: 20
- os: windows-latest
java: 21-ea
name: Tests with Java ${{ matrix.java }} on ${{ matrix.os }}
steps:
- name: Disable Git's autocrlf
run: git config --global core.autocrlf false
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: oracle-actions/setup-java@2c4df2930e35870536667f383d87f1246fbe613f # v1
with:
website: jdk.java.net
java-version: ${{ matrix.java }}
- name: Get date for cache # see https://github.com/actions/cache README
id: get-date
run: echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
shell: bash
- name: Use Maven dependency cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Use silent log config
run: mv chore/logback.xml src/test/resources/
- name: Build
run: |
mvn -f spoon-pom -B test-compile
- name: Fetch final dependencies
# this is a hack to download the final test dependencies required to actually run the tests
run: timeout 20 mvn -f spoon-pom -B test || echo "Done fetching dependencies"
shell: bash
- name: Test
run:
mvn -f spoon-pom test
- name: print run tests
run: cat testResults.spoon
coverage:
runs-on: ubuntu-latest
name: Test with coverage
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0
with:
java-version: 17
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Get date for cache # see https://github.com/actions/cache README
id: get-date
run: echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
shell: bash
- name: Use Maven dependency cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Use silent log config
run: mv chore/logback.xml src/test/resources/
- name: Build
run: |
mvn -f spoon-pom -B test-compile
- name: Test with coverage
run: mvn -f spoon-pom -Pcoveralls test jacoco:report coveralls:report -DrepoToken=$GITHUB_TOKEN -DserviceName=github -DpullRequest=$PR_NUMBER --fail-never
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
extra:
runs-on: ubuntu-latest
name: Extra checks
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
fetch-depth: 0
- uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0
with:
java-version: 11
distribution: ${{ env.JAVA_DISTRIBUTION }}
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: 3.11
- name: Get date for cache # see https://github.com/actions/cache README
id: get-date
run: echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
shell: bash
- name: Use Maven dependency cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Use silent log config
run: mv chore/logback.xml src/test/resources/
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-pip
pip3 install --user CommonMark==0.9.1 requests pygithub
- name: Verify and Site Maven goals
run: mvn verify license:check site -DskipTests -DadditionalJOption=-Xdoclint:syntax,-missing -Dscan
- name: Install spoon-pom
working-directory: spoon-pom
run: mvn install -DskipTests
- name: Checkstyle in src/tests
run: mvn -q checkstyle:checkstyle -Pcheckstyle-test
- name: Check documentation links
run: python3 ./chore/check-links-in-doc.py
- name: Analyze dependencies through DepClean in spoon-core
run: mvn -q depclean:depclean
- name: Spoon-decompiler
working-directory: spoon-decompiler
run: |
mvn -q versions:use-latest-versions -DallowSnapshots=true -Dincludes=fr.inria.gforge.spoon
mvn -q versions:update-parent -DallowSnapshots=true
git diff
mvn -q test
mvn -q checkstyle:checkstyle license:check
mvn -q depclean:depclean
- name: Spoon-control-flow
working-directory: spoon-control-flow
run: |
mvn -q versions:use-latest-versions -DallowSnapshots=true -Dincludes=fr.inria.gforge.spoon
mvn -q versions:update-parent -DallowSnapshots=true
git diff
mvn -q test
mvn -q checkstyle:checkstyle license:check
# spoon dataflow
- name: Cache downloaded file
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
with:
path: spoon-dataflow/z3-4.8.4.d6df51951f4c-x64-ubuntu-14.04.zip
key: ${{ runner.os }}-z3-4.8.4.d6df51951f4c-x64-ubuntu-14.04.zip
restore-keys: |
${{ runner.os }}-z3-4.8.4.d6df51951f4c-x64-ubuntu-14.04.zip
- name: Spoon-dataflow
working-directory: spoon-dataflow
run: |
wget https://projects.ow2.org/download/spoon/WebHome/z3-4.8.4.d6df51951f4c-x64-ubuntu-14.04.zip
unzip z3-4.8.4.d6df51951f4c-x64-ubuntu-14.04.zip
export LD_LIBRARY_PATH=./z3-4.8.4.d6df51951f4c-x64-ubuntu-14.04/bin
./gradlew build
- name: Spoon-visualisation
working-directory: spoon-visualisation
run: |
mvn -q versions:use-latest-versions -DallowSnapshots=true -Dincludes=fr.inria.gforge.spoon
mvn -q versions:update-parent -DallowSnapshots=true
git diff
mvn -q test
mvn -q depclean:depclean
- name: Spoon-smpl
working-directory: spoon-smpl
run: |
mvn -q versions:use-latest-versions -DallowSnapshots=true -Dincludes=fr.inria.gforge.spoon
mvn -q versions:update-parent -DallowSnapshots=true
git diff
mvn -q -Djava.src.version=11 test
mvn -q checkstyle:checkstyle license:check
mvn -q depclean:depclean
- name: Trigger extra tasks
if: github.repository == 'INRIA/spoon' && github.event_name == 'pull_request'
run: |
curl https://raw.githubusercontent.com/SpoonLabs/spoon-ci-external/master/spoon-pull-request.sh | bash
- name: Run Javadoc quality check
run: ./chore/check-javadoc-regressions.py COMPARE_WITH_MASTER
reproducible-builds:
runs-on: ubuntu-latest
name: reproducible-builds
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
fetch-depth: 0
- uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0
with:
java-version: 17
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Check status
run: chore/check-reproducible-builds.sh
maven-central-requirements:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Set up JDK 11
uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3
with:
java-version: '11'
distribution: 'temurin'
# the pom checker needs maven 3.9.0
- name: Set up Maven
uses: stCarolas/setup-maven@07fbbe97d97ef44336b7382563d66743297e442f # v4.5
with:
maven-version: 3.9.0
# we dont enforce that the version must be non snapshot as this is not possible for SNAPSHOT versions in our workflow.
- name: Check maven pom quality
run: mvn -f spoon-pom org.kordamp.maven:pomchecker-maven-plugin:1.9.0:check-maven-central -D"checker.release=false"