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

Commit

Permalink
Merge branch 'update-ci' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
SamR1 committed Aug 6, 2023
2 parents 9c50540 + d22bf1b commit 240e276
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 65 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/.tests-javascript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Javascript CI

on:
push:
paths: ['rdltr_front/**']
pull_request:
paths: ['rdltr_front/**']

env:
working-directory: rdltr_front

jobs:
javascript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install yarn and dependencies
working-directory: ${{env.working-directory}}
run: |
npm install --global yarn
yarn install --ignore-engines
- name: Lint
working-directory: ${{env.working-directory}}
run: yarn lint
- name: Build
working-directory: ${{env.working-directory}}
run: yarn build
74 changes: 74 additions & 0 deletions .github/workflows/.tests-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Python CI

on:
push:
paths-ignore: ['docs/**', 'docsrc/**', 'rdltr_front/**', '*.md']
pull_request:
paths-ignore: ['docs/**', 'docsrc/**', 'rdltr_front/**', '*.md']

jobs:
python:
name: python ${{ matrix.python-version }}
runs-on: ubuntu-latest
container: python:${{ matrix.python-version }}
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
env:
RDLTR_SETTINGS: 'rdltr.config.TestingConfig'
steps:
- uses: actions/checkout@v3
- name: Create and source virtual environment
run: |
python3 -m venv .venv
. .venv/bin/activate
- name: Install dependencies
run: python3 -m pip install -e .[test]
- name: Bandit
if: matrix.python-version == '3.11'
run: bandit -r rdltr -c pyproject.toml
- name: Lint (flake8, isort & black)
if: matrix.python-version == '3.11'
run: |
pytest --isort --black -m "isort or black" rdltr
flake8 rdltr
- name: Mypy
if: matrix.python-version == '3.11'
run: mypy rdltr
- name: Pytest
run: pytest rdltr/tests/tests --cov rdltr --cov-report term-missing

end2end:
name: e2e tests
runs-on: ubuntu-latest
needs: ["python"]
container: python:3.11
services:
selenium:
image: selenium/standalone-firefox
env:
RDLTR_HOST: '0.0.0.0'
RDLTR_SETTINGS: 'rdltr.config.TestingConfig'
RDLTR_DB_TEST_URL: 'sqlite:////tmp/rdltr_test.db'
steps:
- uses: actions/checkout@v3
- name: Update pip and install build
run: python3 -m pip install --upgrade pip build
- name: Create and source virtual environment
run: |
python3 -m venv .venv
. .venv/bin/activate
- name: Build rdltr package
run: python3 -m build
- name: Install rdltr package
run: python3 -m pip install dist/rdltr-$(cat VERSION).tar.gz
- name: Run migrations
run: rdltr_db
- name: Install pytest and selenium
run: python3 -m pip install pytest==7.4.0 pytest-selenium==4.0.1 selenium==4.9.0
- name: Start application and run tests with Selenium
run: |
setsid nohup rdltr >> nohup.out 2>&1 &
export RDLTR_HOST=$(hostname --ip-address)
sleep 5
pytest rdltr/tests/ui_tests --driver Remote --capability browserName firefox --selenium-host selenium --selenium-port 4444
65 changes: 0 additions & 65 deletions .gitlab-ci.yml

This file was deleted.

0 comments on commit 240e276

Please sign in to comment.