-
Notifications
You must be signed in to change notification settings - Fork 34
132 lines (129 loc) · 4.38 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
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@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.jdk }}
- name: Set up cache
uses: actions/cache@v4
with:
path: |
~/ltsmin
~/.m2
!~/.m2/repository/net/automatalib
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: Run Maven
run: mvn -B install site -Pcode-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-13 ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.jdk }}
- name: Set up cache
uses: actions/cache@v4
with:
path: |
~/.m2
!~/.m2/repository/net/automatalib
key: cache-platform-integration-${{ matrix.jdk }}-${{ hashFiles('**/pom.xml') }}
restore-keys: cache-platform-integration-${{ matrix.jdk }}-
- 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@v4
with:
distribution: 'zulu'
java-version: 11
- name: Set up cache
uses: actions/cache@v4
with:
path: |
~/ltsmin
~/.m2
!~/.m2/repository/net/automatalib
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: 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 -Pcode-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@v4
with:
distribution: 'zulu'
java-version: 11
- name: Set up cache
uses: actions/cache@v4
with:
path: |
~/.m2
!~/.m2/repository/net/automatalib
key: cache-deploy-${{ hashFiles('**/pom.xml') }}
restore-keys: cache-deploy-
- 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