Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Merge pull request #101 from vicha-w/sanitise-url #150

Merge pull request #101 from vicha-w/sanitise-url

Merge pull request #101 from vicha-w/sanitise-url #150

Workflow file for this run

name: Django CI - Updated
# Temporarily disable until an image
# with ROOT and python 3.8 is available.
# TODO: use Dockerfile to push an image to Dockerhub perhaps
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-20.04
#container: rootproject/root:6.26.02-ubuntu20.04
strategy:
max-parallel: 4
matrix:
python-version: [3.8]
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: github_actions
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
# options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
#
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
#- name: Install ROOT
# run: |
# sudo apt install dpkg-dev cmake g++ gcc binutils libx11-dev libxpm-dev libxft-dev libxext-dev libssl-dev
# git clone --branch latest-stable --depth=1 https://github.com/root-project/root.git root_src
# mkdir root_build root_install && cd root_build
# cmake -DCMAKE_INSTALL_PREFIX=../root_install ../root_src
# cmake --build . -- install
# source ../root_install/bin/thisroot.sh
# cd ..
# wget -q https://root.cern/download/root_v6.26.10.Linux-ubuntu22-x86_64-gcc11.3.tar.gz
# tar -xzf root_v6.26.10.Linux-ubuntu22-x86_64-gcc11.3.tar.gz
# source root/bin/thisroot.sh
# echo $PYTHONPATH
# - name: Lint with black
# uses: psf/black@stable
# with:
# options: "--check --verbose"
# src: "./"
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --ignore=E50,F401,F403
- name: Run Unit Tests
env:
DIR_PATH_DQMIO_STORAGE: /home/runner/work/MLplayground/MLplayground/histograms/test_files/
DJANGO_DATABASE_ENGINE: ${{ secrets.DJANGO_DATABASE_ENGINE }}
DJANGO_DATABASE_NAME: ${{ secrets.DJANGO_DATABASE_NAME }}
DJANGO_DEBUG: ${{ secrets.DJANGO_DEBUG }}
DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }}
FILE_PATH_EOS_CMSML4DC: ${{ secrets.FILE_PATH_EOS_CMSML4DC }}
run: |
python manage.py test --settings=mlp.test_ci_settings
- name: Run Functional Tests with Selenium on Chrome
env:
DIR_PATH_DQMIO_STORAGE: /home/runner/work/MLplayground/MLplayground/histograms/test_files/
DJANGO_DATABASE_ENGINE: ${{ secrets.DJANGO_DATABASE_ENGINE }}
DJANGO_DATABASE_NAME: ${{ secrets.DJANGO_DATABASE_NAME }}
DJANGO_DEBUG: ${{ secrets.DJANGO_DEBUG }}
DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }}
FILE_PATH_EOS_CMSML4DC: ${{ secrets.FILE_PATH_EOS_CMSML4DC }}
WEB_BROWSER: Chrome
run: |
python manage.py test functional_tests
- name: Run Functional Tests with Selenium on Firefox
env:
DIR_PATH_DQMIO_STORAGE: /home/runner/work/MLplayground/MLplayground/histograms/test_files/
DJANGO_DATABASE_ENGINE: ${{ secrets.DJANGO_DATABASE_ENGINE }}
DJANGO_DATABASE_NAME: ${{ secrets.DJANGO_DATABASE_NAME }}
DJANGO_DEBUG: ${{ secrets.DJANGO_DEBUG }}
DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }}
FILE_PATH_EOS_CMSML4DC: ${{ secrets.FILE_PATH_EOS_CMSML4DC }}
WEB_BROWSER: Firefox
run: |
python manage.py test functional_tests