Skip to content

feat: convenors able to remove team and games (#240) #510

feat: convenors able to remove team and games (#240)

feat: convenors able to remove team and games (#240) #510

Workflow file for this run

name: MLSB Pull-Request Reviews
on:
pull_request:
branches:
- master
- main
- development
push:
branches:
- master
- main
- development
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
# 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 --max-complexity=20 --max-line-length=127 --statistics --exclude=api/__init__.py,api/tqdm.py,api/commands.py,api/app.py,venv/*,ui-testing/*,api/tests/conftest.py,api/model.py --ignore=E712,W503,W504
unit-test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with python unittest
run: |
pip install coverage
export FLASK_ENV="development"
coverage run --omit */api/test/*,initDB.py,tqdm.py,api/admin/__init__.py,venv/* -m unittest discover -s api/test
coverage report --fail-under=70
coverage xml
coverage html
- name: Create Coverage report Artifact
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: htmlcov
- name: Upload Coverage report to CodeCov
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
flags: unittests # optional
name: unittest
token: ${{ secrets.CODECOV_TOKEN }}
pytest:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with pytest
run: |
pip install coverage
export FLASK_ENV="development"
coverage run --omit */api/test/*,initDB.py,tqdm.py,api/admin/__init__.py,venv/* -m pytest
coverage xml
coverage html
- name: Create Coverage report Artifact
uses: actions/upload-artifact@v4
with:
name: coverage-report-pytest
path: htmlcov
- name: Upload Coverage report to CodeCov
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
flags: unittests # optional
name: pytest
token: ${{ secrets.CODECOV_TOKEN }}
cypress:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Set up npm
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: UI Test with cypress
run: |
export ADMIN="admin"
export PASSWORD="password"
export FLASK_ENV="development"
export CYPRESS_baseUrl=http://localhost:8080/
# run the server just in-memory
nohup python -m flask --app api/app run --host=0.0.0.0 --port=8080 2>&1 &
# now run the cypres tests against it
cd ui-testing
npm install
npm run cypress:test
- name: Upload Video Run
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: cypress-videos
path: ui-testing/cypress/videos