-
Notifications
You must be signed in to change notification settings - Fork 2
156 lines (145 loc) · 5.47 KB
/
build.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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
# Copyright (c) 2020 The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Build and Test
on:
push:
# On any push to any branch
schedule:
# Build daily on the default branch at 04:40
- cron: "40 4 * * *"
env:
SETTINGS_FILE: .github/settings.xml
# Workaround for occasional unreliable downloads.
# See https://stackoverflow.com/q/55899091/301832 for details
# Except Maven doesn't use Wagon any more, but Aether.
# https://maven.apache.org/resolver/configuration.html
MAVEN_OPTS: >
-Daether.connector.http.connectionMaxTtl=25
jobs:
compile:
runs-on: ubuntu-latest
timeout-minutes: 100
strategy:
matrix:
# Minimum Java version!
java: [11]
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
cache: 'maven'
- name: "Set up node cache"
uses: actions/cache@v4
with:
path: '~/.m2/repository/com/github/eirslett/node'
key: ${{ runner.os }}-node-${{ hashFiles('SpiNNaker-allocserv/pom.xml') }}
restore-keys: ${{ runner.os }}-node-
- name: Compile
run: mvn clean install --settings $SETTINGS_FILE -B -DskipTests=true -Dmaven.javadoc.skip=true -P "!jsp-precompile"
- name: Resolve Remaining Dependencies
# Explicit get of error_prone_core because of MDEP-830
run: mvn dependency:resolve-plugins dependency:resolve dependency:get@fetch-error-prone --settings $SETTINGS_FILE -B -P "CheckForFIXME,ErrorProne,KeycloakClient,devtools"
test:
needs: compile
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
java: [11, 14, 17]
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Set dns server
run: |
sudo sed -i 's/#DNS=/DNS=8.8.8.8 8.8.4.4/g' /etc/systemd/resolved.conf
sudo systemctl daemon-reload
sudo systemctl restart systemd-networkd
sudo systemctl restart systemd-resolved
- name: Build with Java ${{ matrix.java }}
run: mvn install --settings $SETTINGS_FILE -DskipTests=true -Dmaven.javadoc.skip=true
- name: "Check: Test"
run: mvn verify --settings $SETTINGS_FILE -Dmaven.javadoc.skip=true jacoco:report
- name: "Report: Coverage via coveralls.io"
run: |
export CI_BRANCH=${BRANCH_NAME_OR_REF#refs/heads/}
export CI_PULL_REQUEST=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
mvn coveralls:report --settings $SETTINGS_FILE --no-transfer-progress -DrepoToken=$COVERALLS_SECRET
env:
CI_NAME: github
BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }}
CI_BUILD_NUMBER: ${{ github.run_id }}
CI_BUILD_URL: https://github.com/${{ github.repository }}/commit/${{ github.event.after }}/checks
COVERALLS_SECRET: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Upload Build (JDK 11 only)
if: matrix.java == 11
uses: actions/upload-artifact@v4
with:
name: spinnaker-exe.jar
path: SpiNNaker-front-end/target/spinnaker-exe.jar
retention-days: 5
continue-on-error: true
- name: Submit Dependency Snapshot
if: matrix.java == 11
uses: advanced-security/maven-dependency-submission-action@v4
continue-on-error: true
validate:
needs: compile
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
java: [11, 14]
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
cache: 'maven'
- name: "Check: Error Prone"
if: matrix.java != 14
run: mvn clean test-compile -P "ErrorProne,!jsp-precompile" --settings $SETTINGS_FILE
- name: "Check: Code Style"
run: mvn directory:highest-basedir@find-root checkstyle:check --settings $SETTINGS_FILE
- name: "Check: Documentation"
run: mvn javadoc:aggregate --settings $SETTINGS_FILE -P "!jsp-precompile"
minor-style:
needs: compile
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 11
cache: 'maven'
- name: "Check: No FIXMEs left"
run: mvn exec:exec@check-for-fixme --settings $SETTINGS_FILE -P CheckForFIXME
- name: "Check: copyright declarations"
run: mvn apache-rat:check --settings $SETTINGS_FILE -V || (find . -type f -name 'rat*.txt' -print | xargs grep -l unapproved | xargs cat; exit 1)
- name: "Check: CITATION.cff validity"
uses: dieghernan/cff-validator@v3