Skip to content

Commit

Permalink
Merge pull request #486 from EsupPortail/dev
Browse files Browse the repository at this point in the history
DEV #2.8.2
  • Loading branch information
ptitloup authored Sep 20, 2021
2 parents 06948b9 + cc2a04c commit 059fe03
Show file tree
Hide file tree
Showing 271 changed files with 88,235 additions and 78,528 deletions.
6 changes: 4 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
# on each function you don't want to be covered
[run]
source = pod/
omit = pod/*/settings*.py
omit = pod/*settings*.py
pod/*apps.py
pod/wsgi.py
*/tests/*
*/commands/*
*/migrations/*

pod/video/bbb.py
scripts/bbb-pod-live/*.*
46 changes: 46 additions & 0 deletions .github/workflows/code_formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Code Formatting

on:
push:
branches: [master, dev]

jobs:
code-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Running prettier
run: npx prettier --write pod/*/static/**/*.js

- name: Check for modified files
id: prettier-git-check
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)

- name: Push changes
if: steps.prettier-git-check.outputs.modified == 'true'
run: |
git config user.name github-actions
git config user.email [email protected]
git commit -am "Fixup: format code with Prettier"
- name: Install Black
run: |
python -m pip install --upgrade pip
pip install black
- name: Running Black
run: black . -l 90

- name: Check for modified files
id: black-git-check
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)

- name: Commit changes
if: steps.black-git-check.outputs.modified == 'true'
run: |
git config user.name github-actions
git config user.email [email protected]
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git commit -am "Fixup: format code with Black"
git push
95 changes: 54 additions & 41 deletions .github/workflows/pod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,68 @@ name: Django Pod CI

on:
push:
branches: [ master , dev]
branches: [master, dev]
pull_request:
branches: [ '*' ]
branches: ["*"]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.5, 3.6, 3.7]
python-version: [3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Configure sysctl limits (for ES)
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install ffmpeg
sudo apt-get install -y ffmpegthumbnailer
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install flake8
pip install coveralls
- name: Flake8 compliance
run: |
flake8 --max-complexity=7 --exclude .git,pod/*/migrations/*.py,test_settings.py
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.6.0
- name: Setup Pod
run: |
python manage.py create_pod_index
python manage.py makemigrations
python manage.py migrate
- name: Run Tests and coveralls
env:
- uses: actions/checkout@v2

- name: Configure sysctl limits (for ES)
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

# Remove apt repos that are known to break from time to time
# See https://github.com/actions/virtual-environments/issues/323
- name: Remove broken apt repos [Ubuntu]
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
- name: Install Dependencies
run: |
sudo apt-get clean
sudo apt-get update
sudo apt-get install ffmpeg
sudo apt-get install -y ffmpegthumbnailer
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install flake8
pip install coveralls
- name: Flake8 compliance
run: |
flake8 --max-complexity=7 --ignore=E501,W503,E203 --exclude .git,pod/*/migrations/*.py,test_settings.py
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.6.0

- name: Setup Pod
run: |
python manage.py create_pod_index
python manage.py makemigrations
python manage.py migrate
- name: Run Tests and coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coverage run --source='.' manage.py test --settings=pod.main.test_settings
coveralls --service=github
run: |
coverage run --source='.' manage.py test -v 3 --settings=pod.main.test_settings
coveralls --service=github
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ pod/*/migrations/
pod/custom/*
!pod/custom/settings_local.py.example
settings_local.py
scripts/bbb-pod-live/docker-compose.yml
## Others
pod/static/
*.bak
Expand All @@ -62,4 +63,4 @@ htmlcov
# Certificates #
################
*.crt
*.key
*.key
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore all minified files:
pod/**/*.min.js
Loading

0 comments on commit 059fe03

Please sign in to comment.