-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitlab pipeline
40 lines (37 loc) · 1.25 KB
/
gitlab pipeline
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
# Użycie istniejącego obrazu kontenera z Ubuntu i JDK 17
image: your-registry/your-ubuntu-jdk17-image:latest
# Definicja etapów pipeline'a
stages:
- setup
- test
# Instalacja niezbędnych zależności i przeglądarki
setup-job:
stage: setup
script:
- apt-get update
- apt-get install -y wget unzip xvfb libxi6 libgconf-2-4 maven
- wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -
- sh -c 'echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
- apt-get update
- apt-get install -y google-chrome-stable
- CHROMEDRIVER_VERSION=$(curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE)
- wget -O /tmp/chromedriver.zip https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip
- unzip /tmp/chromedriver.zip -d /usr/local/bin/
- rm /tmp/chromedriver.zip
artifacts:
paths:
- /usr/local/bin/chromedriver
- /usr/bin/google-chrome
# Uruchomienie testów Selenium
test-job:
stage: test
script:
- export DISPLAY=:99
- mvn clean install
- mvn test
dependencies:
- setup-job
artifacts:
when: always
reports:
junit: target/surefire-reports/TEST-*.xml