-
Notifications
You must be signed in to change notification settings - Fork 456
115 lines (103 loc) · 3.87 KB
/
verify-push.yaml
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
name: verify-push
on:
push:
branches-ignore:
- 'master' # no need to run after merging to master
tags-ignore:
- '*' # do not run on pushing tags (see deploy-on-release-created)
pull_request:
jobs:
build:
# run if push or pull_requests from fork
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
module:
- matsim
# sorted from longest to shortest (to minimise the overall test stage duration)
# (used in travis; not respected in GitHub Action workflows)
- contribs/vsp
- contribs/common
- contribs/taxi
- contribs/minibus
- contribs/signals
- contribs/bicycle
- contribs/cadytsIntegration
- contribs/drt
- contribs/discrete_mode_choice
- contribs/carsharing
- contribs/commercialTrafficApplications
- contribs/av
- contribs/locationchoice
- contribs/ev
- contribs/dvrp
- contribs/emissions
- contribs/decongestion
- contribs/noise
- contribs/accidents
- contribs/freight
- contribs/parking
- contribs/matrixbasedptrouter
- contribs/accessibility
- contribs/integration
- contribs/multimodal
- contribs/protobuf
- contribs/socnetsim
- contribs/sumo
- contribs/pseudosimulation
- contribs/roadpricing
- contribs/analysis
- contribs/eventsBasedPTRouter
- contribs/hybridsim
- contribs/otfvis
- contribs/osm
- contribs/application
- contribs/sbb-extensions
- benchmark
steps:
- name: Checkout git repo
uses: actions/checkout@v2
- name: Detect changes against master
# we only want to build matsim (module) if changes are not limited to contribs
id: detect-changes
uses: dorny/paths-filter@v2
if: ${{matrix.module == 'matsim'}}
with:
filters: |
outside-contribs:
- '!contribs/**'
- name: Cache local Maven repository
uses: actions/cache@v2
if: ${{matrix.module != 'matsim' || steps.detect-changes.outputs.outside-contribs == 'true'}}
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup Java
if: ${{matrix.module != 'matsim' || steps.detect-changes.outputs.outside-contribs == 'true'}}
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'adopt'
- name: Build module (with dependencies)
if: ${{matrix.module != 'matsim' || steps.detect-changes.outputs.outside-contribs == 'true'}}
run: mvn install --batch-mode --also-make --projects ${{matrix.module}} -DskipTests -Dsource.skip
- name: Test module
if: ${{matrix.module != 'matsim' || steps.detect-changes.outputs.outside-contribs == 'true'}}
run: mvn verify --batch-mode -Dmaven.test.redirectTestOutputToFile -Dmatsim.preferLocalDtds=true --fail-at-end -Dsource.skip
working-directory: ${{matrix.module}}
env:
MAVEN_OPTS: -Xmx2g
verify-all-jobs-successful:
# always() - to ensure this job is executed (regardless of the status of the previous job)
# run if push or pull_requests from fork
if: always() && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
needs: build
runs-on: ubuntu-latest
steps:
- name: check if the whole job matrix is successful
if: needs.build.result != 'success'
run: exit 1 # fail if "build" was not successful