Skip to content

Similarity performance #41

Similarity performance

Similarity performance #41

Workflow file for this run

name: DP-REX pytests
on:
pull_request:
branches: ["trunk"]
jobs:
backend:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11"]
services:
postgres:
image: postgres:15.4
ports:
- 5432:5432
env:
POSTGRES_USER: vran_db_user_ci
POSTGRES_PASSWORD: vran_db_password_ci
POSTGRES_DB: vran_data_ci
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Install redis
run: |
curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get update
sudo apt-get -y install redis
- name: Setup Python # Set Python version
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
cache-dependency-path: |
pyproject.toml
poetry.lock
# workaround for 3.8
- name: Install dependencies
run: |
poetry env use ${{ matrix.python-version }}
poetry install --no-interaction
- name: Test with pytest
run: |
if [[ ${{ matrix.python-version }} == '3.9' ]]; then
VRAN_REDIS_PORT=6309 poetry run pytest -c pytest_ci.ini --cov-report html:coverage-${{ matrix.python-version }}
fi
if [[ ${{ matrix.python-version }} == '3.10' ]]; then
VRAN_REDIS_PORT=6310 poetry run pytest -c pytest_ci.ini --cov-report html:coverage-${{ matrix.python-version }}
fi
if [[ ${{ matrix.python-version }} == '3.11' ]]; then
VRAN_REDIS_PORT=6311 poetry run pytest -c pytest_ci.ini --cov-report html:coverage-${{ matrix.python-version }}
fi
env:
VRAN_CI: "True"
VRAN_DB_NAME: vran_data_ci
VRAN_DB_USER: vran_db_user_ci
VRAN_DB_PASSWORD: vran_db_password_ci
VRAN_PG_CONF: localhost:5432:vran_data_ci:vran_db_user_ci:vran_db_password_ci
VRAN_PG_SERVICE_FILE: "[vran_service]\nhost=localhost\nuser=vran_db_user_ci\ndbname=vran_data_ci\nport=5432"
VRAN_DJANGO_KEY: ${{ secrets.VRAN_DJANGO_KEY }}
VRAN_REDIS_PASSWORD: ""
VRAN_REDIS_CONF: ""
- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}
path: coverage-${{ matrix.python-version }}
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: "ui"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"
cache-dependency-path: "ui/package-lock.json"
- name: Install frontend dependencies
run: npm ci
- name: Lint frontend
run: npm run lint
- name: test frontend
run: npm run test