-
Notifications
You must be signed in to change notification settings - Fork 7
109 lines (97 loc) · 2.93 KB
/
pull-request.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
name: Pull Request
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout PR
uses: actions/checkout@v4
- name: Update submodules if necessary
run: |
if [ -f '.gitmodules' ]; then
git submodule update --init --recursive --depth=1
else
echo "Repository does not have submodules - nothing to do"
fi
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'zulu'
cache: maven
# Override http://repo.gate.ac.uk to use https:// instead
- name: Configure Maven settings
uses: whelk-io/maven-settings-xml-action@v20
with:
mirrors: >
[
{
"id": "gate.ac.uk-https",
"name": "GATE repo (secure)",
"mirrorOf": "gate.ac.uk",
"url": "https://repo.gate.ac.uk/content/groups/public/"
}
]
repositories: >
[
{
"id": "central",
"name": "Maven Central",
"url": "https://repo1.maven.org/maven2",
"releases": {
"enabled": "true"
},
"snapshots": {
"enabled": "false"
}
}
]
plugin_repositories: >
[
{
"id": "central",
"name": "Maven Central",
"url": "https://repo1.maven.org/maven2",
"releases": {
"enabled": "true"
},
"snapshots": {
"enabled": "false"
}
}
]
- name: Set up python venv
run: |
python3 -mvenv tmpenv
echo "$PWD/tmpenv/bin" >> $GITHUB_PATH
tmpenv/bin/pip install -r python-requirements.txt
- name: Build with Maven
run: mvn --batch-mode -e clean install
- name: Upload Test Results
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: Test Results
path: |
target/surefire-reports/*.xml
- name: Build site
run: mvn --batch-mode -e -DskipTests site
# We want to avoid cacheing -SNAPSHOT dependencies from our local maven
# cache, to ensure that we always go out and check for them again at the
# next build in case they have changed.
- name: Delete snapshots from m2 repository
if: always()
run: |
find ~/.m2/repository -name \*-SNAPSHOT -type d -exec rm -rf {} \+ || :
event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Event File
path: ${{ github.event_path }}