Skip to content

Add CodeArea to Wirecloud #161

Add CodeArea to Wirecloud

Add CodeArea to Wirecloud #161

Workflow file for this run

name: Tests
on:
push:
branches:
- develop
pull_request:
branches:
- develop
jobs:
js-unit-tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
- name: Setup and run tests
working-directory: ./src
run: |
npm ci
npm install grunt-cli -g
grunt ci
- name: Coveralls Parallel
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
flag-name: browsers
base-path: src
path-to-lcov: src/build/coverage/lcov.info
parallel: true
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Use Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Build
working-directory: ./src
run: ./setup.py bdist_wheel
- name: Upload build wheel
uses: actions/upload-artifact@v2
with:
name: wheel
path: src/dist/*.whl
django-unit-tests:
runs-on: ubuntu-20.04
strategy:
matrix:
django-version:
- "2.0"
- "2.1"
- "2.2"
python-version:
#- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
steps:
- name: Setup PostgreSQL
run: |
docker run --rm -e POSTGRES_DB=postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=wirecloud -d -p 5432:5432 --name postgres-wirecloud postgres:latest
- uses: actions/checkout@v2
- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Setup and run tests
working-directory: ./src
env:
DJANGO_VERSION: ${{ matrix.django-version }}
run: |
pip install "Django>=${DJANGO_VERSION},<${DJANGO_VERSION%.*}.$((${DJANGO_VERSION#*.} + 1))"
pip install "psycopg2-binary<2.9"
pip install -r requirements.txt
pip install -r requirements-dev.txt
python manage.py collectstatic -v 0 -c --noinput
coverage run -a --branch --source wirecloud --omit="*/wirecloud/semanticwiring/*,*/wirecloud/guidebuilder/*,*/tests/*,*/tests.py,*/wirecloud/commons/utils/remote.py" manage.py test --noinput --nologcapture -v 2 -a tags='wirecloud-noselenium'
- name: Coveralls Parallel
uses: AndreMiras/coveralls-python-action@develop
with:
github-token: ${{ secrets.github_token }}
flag-name: django-unit-tests-python${{ matrix.python-version }}-django${{ matrix.django-version }}
base-path: src
parallel: true
django-search-indexes-tests:
runs-on: ubuntu-20.04
strategy:
matrix:
engine:
- "Elasticsearch"
- "Solr"
steps:
- name: Setup PostgreSQL
run: |
docker run --rm -e POSTGRES_DB=postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=wirecloud -d -p 5432:5432 --name postgres-wirecloud postgres:latest
- uses: actions/checkout@v2
- name: Use Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Use Elasticsearch
working-directory: ./src
run: |
docker run -p 9200:9200 --rm -d --name elasticsearch-wirecloud elasticsearch:2.4
if: ${{ matrix.engine == 'Elasticsearch' }}
- name: Use Solr
working-directory: ./src
run: |
docker run -p 8983:8983 --rm --name solr-wirecloud -d solr:6
if: ${{ matrix.engine == 'Solr' }}
- name: Setup and run tests
working-directory: ./src
run: |
pip install "Django>=2.2,<2.3"
pip install "psycopg2-binary<2.9"
pip install -r requirements.txt
pip install -r requirements-dev.txt
cp ci_scripts/base_settings.py settings.py
if [ "${{ matrix.engine }}" == "Elasticsearch" ]; then
pip install elasticsearch==2.4.1
cat ci_scripts/templates/elasticsearch-conf.template >> settings.py
else
pip install pysolr
cat ci_scripts/templates/solr-conf.template >> settings.py
mkdir solr_conf
python manage.py build_solr_schema --configure-directory solr_conf
docker exec --user=solr solr-wirecloud bin/solr create -c tester -n basic_config
docker exec solr-wirecloud rm -f /opt/solr/server/solr/tester/conf/managed-schema.xml
docker cp solr_conf/schema.xml solr-wirecloud:/opt/solr/server/solr/tester/conf/
docker cp solr_conf/solrconfig.xml solr-wirecloud:/opt/solr/server/solr/tester/conf/
# Reload the Solr core
curl "http://localhost:8983/solr/admin/cores?action=RELOAD&core=tester"
fi
python manage.py collectstatic -v 0 -c --noinput
coverage run -a --branch --source wirecloud --omit="*/wirecloud/semanticwiring/*,*/wirecloud/guidebuilder/*,*/tests/*,*/tests.py" manage.py test --noinput --nologcapture -v 2 -a tags='wirecloud-search-api'
- name: Coveralls Parallel
uses: AndreMiras/coveralls-python-action@develop
with:
github-token: ${{ secrets.github_token }}
flag-name: django-search-indexes-tests-${{ matrix.engine }}
base-path: src
parallel: true
django-selenium-tests:
runs-on: ubuntu-20.04
steps:
- name: Setup PostgreSQL
run: |
docker run --rm -e POSTGRES_DB=postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=wirecloud -d -p 5432:5432 --name postgres-wirecloud postgres:latest
- name: Use Geckodriver
uses: browser-actions/setup-geckodriver@latest
- uses: actions/checkout@v2
- name: Use Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Use Elasticsearch
working-directory: ./src
run: |
docker run -p 9200:9200 --rm -d --name elasticsearch-wirecloud elasticsearch:2.4
- name: Setup and run tests
working-directory: ./src
env:
MOZ_HEADLESS: 1
run: |
pip install "Django>=2.2,<2.3"
pip install "psycopg2-binary<2.9"
pip install -r requirements.txt
pip install -r requirements-dev.txt
cp ci_scripts/base_settings.py settings.py
pip install elasticsearch==2.4.1
cat ci_scripts/templates/elasticsearch-conf.template >> settings.py
python manage.py collectstatic -v 0 -c --noinput
coverage run -a --branch --source wirecloud --omit="*/wirecloud/semanticwiring/*,*/wirecloud/guidebuilder/*,*/tests/*,*/tests.py" manage.py test --noinput --nologcapture -v 2 -a tags='wirecloud-selenium'
- name: Coveralls Parallel
uses: AndreMiras/coveralls-python-action@develop
with:
github-token: ${{ secrets.github_token }}
flag-name: django-selenium-tests
base-path: src
parallel: true
finish:
needs:
- django-unit-tests
- django-search-indexes-tests
- django-selenium-tests
- js-unit-tests
runs-on: ubuntu-20.04
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true