Skip to content

Commit

Permalink
Merge 4e58c96 into 44dcda2
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Sep 19, 2023
2 parents 44dcda2 + 4e58c96 commit 0945669
Show file tree
Hide file tree
Showing 695 changed files with 81,488 additions and 27,509 deletions.
11 changes: 0 additions & 11 deletions .coveragerc

This file was deleted.

48 changes: 48 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
module.exports = {
'globals': {
'gettext': true,
'ngettext': true,
'interpolate': true,
'process': true,
'require': true
},
'env': {
'browser': true,
'es2021': true,
'node': true
},
'extends': [
'eslint:recommended',
'plugin:react/recommended'
],
'overrides': [],
'parserOptions': {
'ecmaVersion': 'latest',
'sourceType': 'module'
},
'plugins': [
'react'
],
'ignorePatterns': ['**/static/**/*.js'],
'rules': {
'indent': 'off',
'no-empty-pattern': 'off',
'linebreak-style': [
'error',
'unix'
],
'quotes': [
'error',
'single'
],
'semi': [
'error',
'never'
]
},
'settings': {
'react': {
'version': 'detect'
}
}
}
6 changes: 5 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ A clear and concise description of what you expected to happen.
3. Scroll down to '....'
4. See error

### Context / Kontext

Please state your operating system, the RDMO version, and (if applicable) the browser the error occured in.

### References / Verweise

*
*
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ assignees: ''

A clear and concise description of what the problem is, followed by the solution you'd like.

### Affected
### Affected

Who is affected by the change (Users, Managers, Admins)?

Expand All @@ -25,4 +25,4 @@ What sort of related functionality would you like to see in addition?

### References / Verweise

*
*
45 changes: 45 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!--- Provide a general summary of your changes in the Title above --->

## Description
<!--- Describe your changes in detail --->

<!--- This project only accepts pull requests related to open issues --->
<!--- If suggesting a new feature or change, please discuss it in an issue first --->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce --->
<!--- Please link to the issue here: --->
Related issue: #ISSUE_NUMBER

## Motivation and Context
<!--- Why is this change required? What problem does it solve? --->

## How has this been tested?
<!--- Please describe in detail how you tested your changes. --->
<!--- Include details of your testing environment, and the tests you ran to --->
<!--- see how your change affects other areas of the code, etc. --->

## Screenshots (if appropriate)

## Types of Changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## Checklist
<!--- Go over all the following points, and put an `x` in all the boxes that apply. --->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --->
- [ ] I have read the [contributor guide](https://github.com/rdmorganiser/rdmo/blob/master/CONTRIBUTING.md).
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.

<!--- This pull request template is adapted from:
<!--- "open-source-templates", https://github.com/TalAter/open-source-templates (MIT License). --->
<!--- "amazing-github-template", https://github.com/dec0dOS/amazing-github-template (MIT License). --->
28 changes: 24 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
directory: /
schedule:
interval: monthly
target-branch: master
open-pull-requests-limit: 10
target-branch: dependency-updates
labels:
- dependencies
- python
- type:maintenance
- package-ecosystem: github-actions
directory: "/"
directory: /
schedule:
interval: monthly
target-branch: master
open-pull-requests-limit: 10
target-branch: dependency-updates
labels:
- dependencies
- github_actions
- type:maintenance
- package-ecosystem: npm
directory: /
schedule:
interval: monthly
open-pull-requests-limit: 10
target-branch: dependency-updates
labels:
- dependencies
- javascript
- type:maintenance
177 changes: 177 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
name: CI

on:
push:
branches:
- master
pull_request:
# run CI only if files in these whitelisted paths are changed
paths:
- '.github/workflows/**'
- 'rdmo/**'
- 'testing/**'
- .pre-commit-config.yaml
- conftest.py
- package.json
- pyproject.toml

# Ref: https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
PYTHONDONTWRITEBYTECODE: 1
FORCE_COLOR: 1 # colored output by pytest etc.
CLICOLOR_FORCE: 1 # colored output by ruff

jobs:

lint:
name: Lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
- run: python -m pip install --upgrade pip setuptools wheel
- run: python -m pip install -e .[dev]
- name: Set up pre-commit cache
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: lint-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run linters via pre-commit (ruff, eslint)
run: pre-commit run --all-files --color=always

test:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ['3.8', '3.11']
db-backend: [mysql, postgres]
# test Python 3.12 already using 3.12-dev
# release is scheduled for 2023-10-02 (https://peps.python.org/pep-0693/)
# when released: replace "python-version: ['3.8', '3.11']" with python-version: ['3.8', '3.12']
include:
- python-version: '3.12-dev'
db-backend: postgres

name: "Test (Python: ${{ matrix.python-version }}, DB: ${{ matrix.db-backend }})"
needs: lint
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install Dependencies
run: |
sudo apt update
sudo apt install --yes pandoc texlive-xetex
python -m pip install --upgrade pip setuptools wheel
pandoc --version
- name: Install rdmo[mysql] and start mysql
run: |
python -m pip install -e .[ci,mysql]
sudo systemctl start mysql.service
if: matrix.db-backend == 'mysql'
- name: Install rdmo[postgres] and start postgresql
run: |
python -m pip install -e .[ci,postgres]
sudo systemctl start postgresql.service
pg_isready
sudo -u postgres psql --command="CREATE USER postgres_user PASSWORD 'postgres_password' CREATEDB"
if: matrix.db-backend == 'postgres'
- name: Prepare Env
run: |
cp testing/config/settings/${{ matrix.db-backend }}.py testing/config/settings/local.py
cp -r testing/media testing/media_root
mkdir testing/log
- name: Run Tests
run: |
pytest -p randomly -p no:cacheprovider --cov --reuse-db --numprocesses=auto --dist=loadscope
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: '${{ matrix.db-backend }}: ${{ matrix.python-version }}'
COVERALLS_PARALLEL: true

coveralls:
name: Indicate completion to coveralls
needs: test
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Run Coveralls finish
run: |
python -m pip install coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

dev-setup:
# Ref: structlog (MIT licensed) <https://github.com/hynek/structlog/blob/main/.github/workflows/ci.yml>
name: "Test dev setup on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
- run: python -Im pip install -e .[dev]
- run: python -Ic 'import rdmo; print(rdmo.__version__)'

optional-dependencies:
name: Test installation of optional-dependencies
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
- name: Install os requirements for python-ldap
run: |
sudo apt update
sudo apt install --yes libldap2-dev libsasl2-dev
- run: python -m pip install --upgrade pip setuptools
- run: python -m pip install .[allauth,ci,dev,gunicorn,ldap,memcached,mysql,postgres,pytest]
- run: python -m pip freeze
- run: python -m pip list --outdated

webpack-build:
name: Test webpack-build
needs: lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- run: npm install --dev
- run: npm run build
- run: npm run build:prod

required-checks-pass:
if: always()
needs:
- lint
- test
- coveralls
- dev-setup
- optional-dependencies
- webpack-build
runs-on: ubuntu-22.04
steps:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
Loading

0 comments on commit 0945669

Please sign in to comment.