-
Notifications
You must be signed in to change notification settings - Fork 6
121 lines (103 loc) · 3.92 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
name: test
on: [ push, pull_request ]
env:
MAVEN_OPTS: -Xmx1024M -Xss128M
GECKODRIVER_VERSION: 0.27.0
BIBUTILS_VERSION: 6.10
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 17
distribution: temurin
- name: Fetch Geckodriver cache
id: geckodriver-cache
uses: actions/cache@v2
with:
path: ~/geckodriver
key: ${{ env.GECKODRIVER_VERSION }}
- name: Fetch Geckodriver
if: steps.geckodriver-cache.outputs.cache-hit != 'true'
run: |
mkdir ~/geckodriver
curl -L https://github.com/mozilla/geckodriver/releases/download/v${GECKODRIVER_VERSION}/geckodriver-v${GECKODRIVER_VERSION}-linux64.tar.gz | \
tar -C ~/geckodriver/ -xzvf-
- name: Fetch Bibutils cache
id: bibutils-cache
uses: actions/cache@v2
with:
path: ~/bibutils
key: ${{ env.BIBUTILS_VERSION }}
- name: Fetch Bibutils
if: steps.bibutils-cache.outputs.cache-hit != 'true'
run: |
mkdir ~/bibutils
curl -L https://kumisystems.dl.sourceforge.net/project/bibutils/bibutils_${BIBUTILS_VERSION}_src.tgz | \
tar -C ~/bibutils --strip-components=1 -xzvf-
cd ~/bibutils
./configure
make -j2
- name: Set up test dependencies
run: |
# PPA by Mozilla for ESR releases
# replace 'sudo add-apt-repository ppa:mozillateam/ppa' with simple commands as workaround for https://github.com/orgs/community/discussions/69720
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0AB215679C571D1C8325275B9BDB3D89CE49EC21
sudo add-apt-repository "deb https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/ focal main"
sudo apt update
sudo apt install firefox-esr chromium-browser chromium-chromedriver dbus-x11
# Selenium wants to run non-ESR FF
sudo rm -rf /usr/lib/firefox/
sudo ln -s firefox-esr /usr/lib/firefox
sudo ln -s firefox-esr /usr/lib/firefox/firefox
firefox --version
~/geckodriver/geckodriver --version
echo "${HOME}/geckodriver" >> $GITHUB_PATH
echo "${HOME}/bibutils/bin" >> $GITHUB_PATH
- name: Restore Maven cache
uses: skjolber/maven-cache-github-action@v1
with:
step: restore
- name: Build
run: |
export $(dbus-launch)
mkdir ~/tmp
export TMPDIR=~/tmp
export FIREFOX_BIN=$(which firefox-esr)
export SELENIUM_BROWSER=firefox
mvn -B -P!standard-with-extra-repos -Djetty clean install
mvn -P!standard-with-extra-repos -B javadoc:javadoc
- name: Login to Docker Hub
if: contains('refs/heads/2022.06.x refs/heads/main', github.ref) && github.event_name=='push' && success()
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build the mir Docker images and push them
if: contains('refs/heads/2022.06.x refs/heads/main', github.ref) && github.event_name=='push' && success()
run: |
docker build . --file Dockerfile --tag mycoreorg/mir:${GITHUB_REF_NAME}
docker build mir-webapp/src/main/solr/ --file mir-webapp/src/main/solr/Dockerfile --tag mycoreorg/mir-solr:${GITHUB_REF_NAME}
docker push mycoreorg/mir:${GITHUB_REF_NAME}
docker push mycoreorg/mir-solr:${GITHUB_REF_NAME}
- name: Upload logs on build failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
./**/surefire-reports
./**/failsafe-reports
./**/screenshots
./**/*error*.log
./**/*test.log
- name: Save Maven cache
uses: skjolber/maven-cache-github-action@v1
with:
step: save