Skip to content

fix for login bug with email link protection #672

fix for login bug with email link protection

fix for login bug with email link protection #672

Workflow file for this run

name: Build and Test App
on:
push:
branches: [ develop, main, ]
pull_request:
branches: [ develop, main, ]
jobs:
build_vue:
runs-on: ubuntu-latest
continue-on-error: false
strategy:
matrix:
node-version: [16]
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: 'babex-vue/package-lock.json'
- name: Install node deps
run: |
cd babex-vue
npm ci
- name: Lint Vue app
run: |
cd babex-vue
npm run lint
- name: Build Vue app
if: always() # continue with build when linting fails
run: |
cd babex-vue
npm run build
- name: Package app
run: |
cd lab/main/static/
tar cvf babex-vue.tar vue
gzip babex-vue.tar
- uses: actions/upload-artifact@v4
with:
name: babex-vue
path: lab/main/static/babex-vue.tar.gz
build:
needs: build_vue
runs-on: ubuntu-latest
continue-on-error: false
strategy:
max-parallel: 2
matrix:
python-version: ['3.10']
app: ['lab', 'parent']
steps:
- name: Install OS dependencies
run: |
sudo apt-get update
sudo apt-get install -y libldap2-dev libsasl2-dev libssl-dev gettext poppler-utils poppler-data libpoppler-cpp-dev
- 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: |
python -m pip install --upgrade pip
cd ${{ matrix.app }}
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install flake8 pytest
- name: pip freeze
run: |
pip freeze
- name: Lint with flake8
run: |
cd ${{ matrix.app }}
# 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 --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Compile 18n
run: |
cd ${{ matrix.app }}
python manage.py compilemessages
- name: Check for missing migrations
run: |
cd ${{ matrix.app }}
python manage.py makemigrations --check --dry-run
- name: Run django tests
run: |
cd ${{ matrix.app }}
make test
- name: Download vue app
uses: actions/download-artifact@v4
with:
name: babex-vue
- name: Unpack vue app
run: |
# deploy vue app twice
tar xzf babex-vue.tar.gz -C lab/main/static/
tar xzf babex-vue.tar.gz -C parent/parent/static/
- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(pip freeze | grep ^playwright | cut -d= -f3)" >> $GITHUB_ENV
- name: Cache playwright binaries
uses: actions/cache@v3
id: playwright-cache
with:
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
path: ~/.cache/ms-playwright
- name: Integration tests
run: |
cd ${{ matrix.app }}
playwright install
export DJANGO_ALLOW_ASYNC_UNSAFE=1
make testint
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.app }}-pytest_logs
path: ${{ matrix.app }}/test-results
integration:
needs: build
runs-on: ubuntu-latest
continue-on-error: false
strategy:
matrix:
python-version: ['3.10']
steps:
- name: Install OS dependencies
run: |
sudo apt-get update
sudo apt-get install -y libldap2-dev libsasl2-dev libssl-dev gettext poppler-utils poppler-data libpoppler-cpp-dev xmlsec1
- 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: |
python -m pip install --upgrade pip
pip install flake8 pytest
cd parent
pip install -r requirements.txt
pip install -r requirements-dev.txt
cd ../lab
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Compile 18n
run: |
cd lab
python manage.py compilemessages
- name: Compile 18n
run: |
cd parent
python manage.py compilemessages
- name: Download vue app
uses: actions/download-artifact@v4
with:
name: babex-vue
- name: Unpack vue app
run: |
tar xzf babex-vue.tar.gz -C lab/main/static/
tar xzf babex-vue.tar.gz -C parent/parent/static/
- name: Integration tests
run: |
cd integration_tests
playwright install
export DJANGO_ALLOW_ASYNC_UNSAFE=1
pytest --tracing retain-on-failure
- uses: actions/upload-artifact@v4
if: failure()
with:
name: integration-pytest_logs
path: integration_tests/test-results