forked from hernanponcedeleon/Dat3M
-
Notifications
You must be signed in to change notification settings - Fork 0
208 lines (167 loc) · 6.08 KB
/
maven.yml
File metadata and controls
208 lines (167 loc) · 6.08 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
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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Build
# https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
push:
branches: [ master, development ]
pull_request:
branches: [ master, development ]
schedule:
- cron: '0 0 * * 2' # Run weekly
workflow_dispatch:
jobs:
asm-tests:
name: Asm tests
runs-on: ubuntu-latest
if: ${{ github.event_name != 'schedule' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up the Java JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: maven
- name: Set DAT3M_HOME
run: echo "DAT3M_HOME=$(echo $GITHUB_WORKSPACE)" >> $GITHUB_ENV
- name: Set DAT3M_OUTPUT
run: echo "DAT3M_OUTPUT=$(echo $DAT3M_HOME)/output" >> $GITHUB_ENV
- name: Asm tests
run: mvn test -Dtest="com/dat3m/dartagnan/asm/**/*" -f dartagnan/pom.xml
litmus-tests:
name: Litmus tests
runs-on: ubuntu-latest
if: ${{ github.event_name != 'schedule' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up the Java JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: maven
- name: Set DAT3M_HOME
run: echo "DAT3M_HOME=$(echo $GITHUB_WORKSPACE)" >> $GITHUB_ENV
- name: Set DAT3M_OUTPUT
run: echo "DAT3M_OUTPUT=$(echo $DAT3M_HOME)/output" >> $GITHUB_ENV
- name: Litmus tests
run: mvn test -Dtest="com/dat3m/dartagnan/litmus/**/*" -f dartagnan/pom.xml
llvm-tests:
name: LLVM tests
runs-on: ubuntu-latest
if: ${{ github.event_name != 'schedule' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up the Java JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: maven
- name: Set DAT3M_HOME
run: echo "DAT3M_HOME=$(echo $GITHUB_WORKSPACE)" >> $GITHUB_ENV
- name: Set DAT3M_OUTPUT
run: echo "DAT3M_OUTPUT=$(echo $DAT3M_HOME)/output" >> $GITHUB_ENV
- name: LLVM tests
run: mvn test -Dtest="com/dat3m/dartagnan/llvm/**/*" -f dartagnan/pom.xml
other-tests:
name: Other tests
runs-on: ubuntu-latest
if: ${{ github.event_name != 'schedule' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up the Java JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: maven
- name: Set DAT3M_HOME
run: echo "DAT3M_HOME=$(echo $GITHUB_WORKSPACE)" >> $GITHUB_ENV
- name: Set DAT3M_OUTPUT
run: echo "DAT3M_OUTPUT=$(echo $DAT3M_HOME)/output" >> $GITHUB_ENV
- name: Other tests
run: mvn test -Dtest="com/dat3m/dartagnan/others/**/*" -f dartagnan/pom.xml
- name: Encoding tests
run: mvn test -Dtest="com/dat3m/dartagnan/encoding/**/*" -f dartagnan/pom.xml
- name: Parsers tests
run: mvn test -Dtest="com/dat3m/dartagnan/parsers/**/*" -f dartagnan/pom.xml
spirv-tests:
name: SPIRV tests
runs-on: ubuntu-latest
if: ${{ github.event_name != 'schedule' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up the Java JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: maven
- name: Set DAT3M_HOME
run: echo "DAT3M_HOME=$(echo $GITHUB_WORKSPACE)" >> $GITHUB_ENV
- name: Set DAT3M_OUTPUT
run: echo "DAT3M_OUTPUT=$(echo $DAT3M_HOME)/output" >> $GITHUB_ENV
- name: SPIRV tests
run: mvn test -Dtest="com/dat3m/dartagnan/spirv/**/*" -f dartagnan/pom.xml
weekly:
name: All tests
runs-on: ubuntu-latest
if: github.event_name == 'schedule'
steps:
- name: Checkout development branch
uses: actions/checkout@v4
with:
ref: development
- name: Checkout badges branch dedicated to storing badges only
uses: actions/checkout@v4
with:
ref: badges
path: badges
- name: Set up the Java JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: maven
- name: Set DAT3M_HOME
run: echo "DAT3M_HOME=$(echo $GITHUB_WORKSPACE)" >> $GITHUB_ENV
- name: Set DAT3M_OUTPUT
run: echo "DAT3M_OUTPUT=$(echo $DAT3M_HOME)/output" >> $GITHUB_ENV
- name: Build with Maven
run: mvn --batch-mode --update-snapshots install
- name: Build the Docker image
run: docker build . --file Dockerfile
- name: Generate JaCoCo Badge
id: jacoco
uses: cicirello/jacoco-badge-generator@v2
with:
badges-directory: badges
coverage-badge-filename: coverage.svg
generate-branches-badge: true
branches-badge-filename: branches.svg
jacoco-csv-file: dartagnan/target/site/jacoco/jacoco.csv
- name: Log coverage percentage
run: |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
echo "branch coverage = ${{ steps.jacoco.outputs.branches }}"
- name: Commit the badges (if changed)
if: ${{ github.event_name == 'schedule' }}
run: |
cd badges
if [[ `git status --porcelain *.svg` ]]; then
git config --global user.name 'Hernan Ponce de Leon'
git config --global user.email 'hernanponcedeleon@users.noreply.github.com'
git add *.svg
git commit -m "Autogenerated JaCoCo coverage badge" *.svg
git push
fi