-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Gitlab Action CI pipeline #152
- Loading branch information
1 parent
0999498
commit 5b7aee0
Showing
1 changed file
with
43 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,51 @@ | ||
image: node:16 | ||
image: cimg/base:stable-20.04 | ||
|
||
services: | ||
- name: selenium/standalone-chrome | ||
alias: selenium | ||
|
||
variables: | ||
CHROME_VERSION: "115.0.5790.110-1" | ||
CHROME_DRIVER_VERSION: "114.0.5735.90" | ||
NODE_OPTIONS: "--openssl-legacy-provider" | ||
|
||
before_script: | ||
- sudo apt-get update -qq | ||
- sudo apt-get upgrade -qqy | ||
- sudo apt-get install -yqq vim links lynx git diffutils htop curl wget p7zip-full unzip zip sed gcc g++ make libfreetype6-dev libaio1 libaio-dev libonig-dev libpng-dev | ||
- sudo apt-get install -yqq xvfb libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3.0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 libnss3 | ||
- curl -sL https://deb.nodesource.com/setup_18.x | sudo bash - | ||
- sudo apt-get install -y nodejs | ||
- sudo npm install -g yarn | ||
- sudo apt-get update | ||
- sudo apt-get install -y openjdk-11-jre openjdk-11-jre-headless openjdk-11-jdk openjdk-11-jdk-headless | ||
- sudo apt-get install -y libu2f-udev | ||
- sudo apt-get install -y libappindicator1 fonts-liberation libgbm1 libgtk-3-0 xdg-utils | ||
- wget https://mirror.cs.uchicago.edu/google-chrome/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb | ||
- sudo dpkg -i google-chrome-stable_${CHROME_VERSION}_amd64.deb | ||
- rm google-chrome-stable_${CHROME_VERSION}_amd64.deb | ||
- wget http://chromedriver.storage.googleapis.com/${CHROME_DRIVER_VERSION}/chromedriver_linux64.zip | ||
- unzip chromedriver_linux64.zip | ||
- sudo chmod +x chromedriver | ||
- sudo mv chromedriver /usr/bin/ | ||
- rm chromedriver_linux64.zip | ||
|
||
stages: | ||
- setup | ||
- build | ||
- test | ||
|
||
check: | ||
stage: setup | ||
webship-js-build: | ||
stage: build | ||
script: | ||
# Install Node.js and yarn | ||
- apt-get update -qy | ||
- apt-get install -y nodejs yarn | ||
|
||
# Install Google Chrome and Chromedriver | ||
- apt-get install -y wget unzip | ||
- wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | ||
- dpkg -i google-chrome*.deb | ||
- apt-get -f install -y | ||
- CHROMEDRIVER_VERSION=$(curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE) | ||
- wget -q https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip | ||
- unzip chromedriver_linux64.zip | ||
- mv chromedriver /usr/local/bin/ | ||
- chmod +x /usr/local/bin/chromedriver | ||
|
||
# Install dependencies and run Webpack | ||
- wget https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.4.0/selenium-server-4.4.0.jar | ||
- nohup java -jar selenium-server-4.4.0.jar standalone > selenium.log 2>&1 & | ||
- yarn install | ||
- yarn start | ||
- node webship-init -ci circleci -os linux -b chrome | ||
- export NODE_OPTIONS=--openssl-legacy-provider | ||
- yarn start & | ||
- yarn test | ||
|
||
# Show the logs for the GitLab Selenium Server service | ||
- mkdir -p selenium/ && curl -s http://localhost:8080/logs.tar.gz | tar -xvzf - -C selenium/ | ||
- mkdir -p selenium/ && curl http://localhost:8080/server-log --output selenium/server-log.txt | ||
artifacts: | ||
when: always | ||
paths: | ||
- selenium/ | ||
variables: | ||
SELENIUM_REMOTE_URL: http://localhost:8080 | ||
GITLAB_TARGET_SELENIUM_REMOTE_URL: http://localhost:4444/wd/hub | ||
|
||
only: | ||
refs: | ||
- tags | ||
- branches |