Handle a couple of edge cases #1087
Workflow file for this run
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
name: Liveblog CI | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
env: | |
CI: true | |
SYNDICATION_VALIDATE_AUTH: 0 | |
MAIL_SERVER: 'localhost' | |
MAIL_PORT: 2225 | |
MAIL_USERNAME: __EMPTY__ | |
MAIL_PASSWORD: __EMPTY__ | |
MAIL_USE_TLS: 0 | |
MAIL_USE_SSL: 0 | |
MAIL_DEBUG: 1 | |
MAIL_SUPPRESS_SEND: true | |
IFRAMELY_KEY: ${{ secrets.IFRAMELY_KEY }} | |
SUPERDESK_URL: 'http://localhost:5000/api' | |
SUPERDESK_CLIENT_URL: 'http://localhost:9000' | |
WEB_CONCURRENCY: 3 | |
WEB_TIMEOUT: 8 | |
SUPERDESK_TESTING: true | |
MARKETPLACE: true | |
SYNDICATION: true | |
services: | |
mongodb: | |
image: mongo:3.4.23 | |
ports: | |
- 27017:27017 | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
elasticsearch-1.7.2: | |
image: barnybug/elasticsearch:1.7.2 | |
ports: | |
- 9200:9200 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: nanasess/setup-chromedriver@master | |
- name: Cache node modules | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./client/package.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Cache pip modules | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-pip-modules | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./server/dev-requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Setup Nodejs 10.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 10.x | |
- name: Setup Python 3.6.x | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.6.x | |
- name: Install Python dependencies and run tests | |
working-directory: ./server | |
run: | | |
pip install 'pip<=20.2.3' | |
pip install 'setuptools<50' | |
pip install -r dev-requirements.txt | |
pytest --ignore=src/ -v | |
behave --format progress2 --logging-level ERROR | |
- name: Install Nodejs dependencies and lint | |
working-directory: ./client | |
run: | | |
npm config set loglevel warn | |
npm install -g grunt-cli | |
npm ci | |
npm run lint | |
- name: Initialize app data | |
working-directory: ./server | |
run: | | |
python app_init_elastic.py | |
python manage.py app:initialize_data | |
python manage.py users:create -u admin -p admin -e 'admin@example.com' --admin | |
python manage.py register_local_themes | |
python manage.py register_bloglist | |
- name: Start backend services | |
working-directory: ./server | |
run: | | |
(nohup honcho start &) | |
(nohup sudo python -m smtpd -n -c DebuggingServer localhost:2225 &) | |
- name: Build client and run e2e tests | |
working-directory: ./client | |
run: | | |
grunt build --server='http://localhost:5000/api' --ws='ws://localhost:5100' | |
cd dist | |
while [ ! -f index.html ]; do sleep .5; done | |
(nohup python -m http.server 9000 &) | |
export DISPLAY=:99 | |
export SELENIUM_ADDRESS='http://localhost:4444/wd/hub' | |
chromedriver --port=4444 --url-base=/wd/hub & | |
sudo Xvfb -ac :99 -screen 0 1920x1080x24 > /dev/null 2>&1 & | |
$CHROME_BIN --version | |
cd ../ | |
npm run e2e |