-
Notifications
You must be signed in to change notification settings - Fork 54
176 lines (173 loc) · 7.05 KB
/
ci.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
name: CI
on: [ push, pull_request ]
env:
LTSMIN_VERSION: v3.1.0
LTSMIN_REPO: Meijuh
jobs:
tests-and-analysis:
name: "Tests and Analysis (JDK: ${{ matrix.jdk }})"
strategy:
matrix:
jdk: [ 11, 17, 21 ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.jdk }}
- name: Set up cache
uses: actions/cache@v3
with:
path: |
~/ltsmin
~/.m2
!~/.m2/repository/net/automatalib
!~/.m2/repository/de/learnlib
key: cache-tests-and-analysis-${{ matrix.jdk }}-${{ hashFiles('**/pom.xml') }}
restore-keys: cache-tests-and-analysis-${{ matrix.jdk }}-
- name: Set up GraphViz
run: sudo apt-get install graphviz
- name: Set up LTSmin
shell: bash
run: |
$GITHUB_WORKSPACE/.github/install-ltsmin.sh
echo "$HOME/ltsmin/${{ env.LTSMIN_VERSION }}/bin" >> $GITHUB_PATH
- name: Set up AutomataLib
shell: bash
# Set environment variables "AUTOMATALIB_FORK" and "AUTOMATALIB_BRANCH" to build custom AutomataLib versions.
# Defaults are "LearnLib" and the current/targeted LearnLib branch ($GITHUB_REF, relies on the same naming
# conventions between AutomataLib and LearnLib branches).
run: |
git clone -b ${AUTOMATALIB_BRANCH:-develop} --single-branch https://github.com/${AUTOMATALIB_FORK:-LearnLib}/automatalib.git ${HOME}/automatalib-git
cd ${HOME}/automatalib-git
mvn -B install -DskipTests
cd $GITHUB_WORKSPACE
- name: Run Maven
run: mvn -B install site -Pintegration-tests,code-analysis,bundles,jlink
platform-integration:
name: "Platform Integration (JDK: ${{ matrix.jdk }}, OS: ${{ matrix.os }})"
needs: [ tests-and-analysis ]
strategy:
matrix:
jdk: [ 11, 17, 21 ]
os: [ ubuntu-latest, windows-latest, macOS-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.jdk }}
- name: Set up cache
uses: actions/cache@v3
with:
path: |
~/.m2
!~/.m2/repository/net/automatalib
!~/.m2/repository/de/learnlib
key: cache-platform-integration-${{ matrix.jdk }}-${{ hashFiles('**/pom.xml') }}
restore-keys: cache-platform-integration-${{ matrix.jdk }}-
- name: Set up AutomataLib
shell: bash
# Set environment variables "AUTOMATALIB_FORK" and "AUTOMATALIB_BRANCH" to build custom AutomataLib versions.
# Defaults are "LearnLib" and the current/targeted LearnLib branch ($GITHUB_REF, relies on the same naming
# conventions between AutomataLib and LearnLib branches).
run: |
git clone -b ${AUTOMATALIB_BRANCH:-develop} --single-branch https://github.com/${AUTOMATALIB_FORK:-LearnLib}/automatalib.git ${HOME}/automatalib-git
cd ${HOME}/automatalib-git
mvn -B install -DskipTests
cd $GITHUB_WORKSPACE
- name: Run Maven
run: mvn -B install -Pjlink
coverage:
name: "Coverage"
needs: [ platform-integration ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
- name: Set up cache
uses: actions/cache@v3
with:
path: |
~/ltsmin
~/.m2
!~/.m2/repository/net/automatalib
!~/.m2/repository/de/learnlib
key: cache-coverage-${{ hashFiles('**/pom.xml') }}
restore-keys: cache-coverage-
- name: Set up GraphViz
run: sudo apt-get install graphviz
- name: Set up LTSmin
shell: bash
run: |
$GITHUB_WORKSPACE/.github/install-ltsmin.sh
echo "$HOME/ltsmin/${{ env.LTSMIN_VERSION }}/bin" >> $GITHUB_PATH
- name: Set up AutomataLib
shell: bash
# Set environment variables "AUTOMATALIB_FORK" and "AUTOMATALIB_BRANCH" to build custom AutomataLib versions.
# Defaults are "LearnLib" and the current/targeted LearnLib branch ($GITHUB_REF, relies on the same naming
# conventions between AutomataLib and LearnLib branches).
run: |
git clone -b ${AUTOMATALIB_BRANCH:-develop} --single-branch https://github.com/${AUTOMATALIB_FORK:-LearnLib}/automatalib.git ${HOME}/automatalib-git
cd ${HOME}/automatalib-git
mvn -B install -DskipTests
cd $GITHUB_WORKSPACE
- name: Run Coverage # see https://github.com/trautonen/coveralls-maven-plugin/issues/136
env:
CI_NAME: github
CI_BUILD_NUMBER: ${{ github.run_id }}
CI_BUILD_URL: https://github.com/${{ github.repository }}/commit/${{ github.event.after }}/checks
BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }}
run: |
export CI_BRANCH=${BRANCH_NAME_OR_REF#refs/heads/}
export CI_PULL_REQUEST=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
mvn -B install -Pintegration-tests,code-coverage
mvn -B coveralls:report -DrepoToken=${{ secrets.GITHUB_TOKEN }} -DpullRequest=${{ github.event.number }}
deploy:
name: "Deploy"
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/develop' }}
needs: [ platform-integration ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
- name: Set up cache
uses: actions/cache@v3
with:
path: |
~/.m2
!~/.m2/repository/net/automatalib
!~/.m2/repository/de/learnlib
key: cache-deploy-${{ hashFiles('**/pom.xml') }}
restore-keys: cache-deploy-
- name: Set up AutomataLib
shell: bash
# Set environment variables "AUTOMATALIB_FORK" and "AUTOMATALIB_BRANCH" to build custom AutomataLib versions.
# Defaults are "LearnLib" and the current/targeted LearnLib branch ($GITHUB_REF, relies on the same naming
# conventions between AutomataLib and LearnLib branches).
run: |
git clone -b ${AUTOMATALIB_BRANCH:-develop} --single-branch https://github.com/${AUTOMATALIB_FORK:-LearnLib}/automatalib.git ${HOME}/automatalib-git
cd ${HOME}/automatalib-git
mvn -B install -DskipTests
cd $GITHUB_WORKSPACE
- name: Run Maven
env: # make secrets available as environment variables
OSSRH_TOKEN_USERNAME: ${{ secrets.OSSRH_TOKEN_USERNAME }}
OSSRH_TOKEN_PASSWORD: ${{ secrets.OSSRH_TOKEN_PASSWORD }}
run: mvn -B -s $GITHUB_WORKSPACE/.github/settings.xml -DskipTests deploy