Skip to content

Fix notification_emails field showing up empty in RB #6017

Fix notification_emails field showing up empty in RB

Fix notification_emails field showing up empty in RB #6017

Workflow file for this run

name: CI
on:
push:
branches:
- master
- '*.x'
pull_request:
branches:
- master
- '*.x'
jobs:
setup:
name: setup-${{ matrix.name }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- { name: '3.9', python: '3.9', tox: py39 }
- { name: '3.10', python: '3.10', tox: py310 }
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
id: cache-npm
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('package*.json') }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Setup Node
uses: actions/setup-node@v3
if: steps.cache-npm.outputs.cache-hit != 'true'
with:
node-version: 14.x
- name: Install system dependencies
run: sudo apt-get install libpq-dev
- name: Create virtualenv
run: |
python${{ matrix.python }} -m venv .venv
source .venv/bin/activate
pip install -U pip setuptools wheel
- name: Activate virtualenv for later steps
run: |
echo "VIRTUAL_ENV=$(pwd)/.venv" >> $GITHUB_ENV
echo "$(pwd)/.venv/bin" >> $GITHUB_PATH
- name: Get pip cache dir
id: pip-cache
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Cache pip
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('requirements*.txt') }}
- name: Install python dependencies
run: |
pip install -r requirements.dev.txt
pip install -r requirements.txt
- name: Install node dependencies
if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm ci
- name: Archive environment
run: tar cf /tmp/env.tar .venv node_modules
- name: Upload environment
uses: actions/upload-artifact@v3
with:
name: environment-${{ matrix.name }}
retention-days: 1
path: /tmp/env.tar
lint:
needs: setup
runs-on: ubuntu-20.04
steps:
# BEGIN common steps - edit all occurrences if needed!
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 14.x
- name: Download environment
uses: actions/download-artifact@v3
with:
name: environment-3.10
path: /tmp
- name: Restore environment
run: tar xf /tmp/env.tar
- name: Activate virtualenv for later steps
run: |
echo "VIRTUAL_ENV=$(pwd)/.venv" >> $GITHUB_ENV
echo "$(pwd)/.venv/bin" >> $GITHUB_PATH
- name: Install Indico
run: pip install -e .
# END common steps
- name: Check import sorting
run: isort --diff --check-only indico/
- name: Check backref comments
if: success() || failure()
run: python bin/maintenance/update_backrefs.py --ci
- name: Check headers
if: success() || failure()
run: |
echo "::add-matcher::.github/matchers/headers-problem-matcher.json"
python bin/maintenance/update_header.py --ci
echo "::remove-matcher owner=headers::"
- name: Run flake8
if: success() || failure()
run: |
echo "::add-matcher::.github/matchers/flake8-problem-matcher.json"
flake8 --format '%(path)s:%(row)d:%(col)d: %(code)s %(text)s'
echo "::remove-matcher owner=flake8::"
- name: Run pyquotes
if: success() || failure()
run: pyquotes --check .
- name: Try extracting i18n strings (Python)
if: success() || failure()
run: indico i18n extract-messages
- name: Try extracting i18n strings (JS)
if: success() || failure()
run: |
echo "::add-matcher::.github/matchers/react-jsx-i18n-problem-matcher.json"
FORCE_COLOR=1 npx react-jsx-i18n extract --ext jsx indico/web/client/ indico/modules/ > /dev/null
echo "::remove-matcher owner=react-jsx-i18n::"
- name: Check i18n format strings
if: success() || failure()
run: indico i18n check-format-strings
- name: Run eslint
if: success() || failure()
run: npx eslint --ext .js --ext .jsx
indico/modules/rb/
indico/modules/logs/
indico/modules/events/editing/
indico/modules/events/client/js/reviewing/
indico/modules/events/papers/client/js/
indico/modules/events/registration/client/js/
indico/web/client/js/react/
indico/modules/users/
indico/modules/search/
- name: Run stylelint for all files
if: github.event_name == 'push' && (success() || failure())
run: |
echo "::add-matcher::.github/matchers/stylelint-problem-matcher.json"
npx stylelint --formatter unix 'indico/**/*.{scss,css}'
echo "::remove-matcher owner=stylelint::"
# GitHub shows annotations for files not touched in the PR, which is very noisy in case
# of stylelint warnings, so we only run it for changed files when running on PRs
# https://github.com/actions/toolkit/issues/457
- name: Get list of changed files
if: github.event_name == 'pull_request' && (success() || failure())
uses: umani/changed-files@v4.0.1
with:
repo-token: ${{ github.token }}
result-encoding: json
pattern: '^.+\.s?css$'
- name: Run stylelint for changed files
if: github.event_name == 'pull_request' && (success() || failure())
run: |
echo "::add-matcher::.github/matchers/stylelint-problem-matcher.json"
jq -rs '(.[0] + .[1]) | unique | .[]' ~/files_{created,updated}.json | tr '\n' '\0' | xargs -0 -r \
npx stylelint --formatter unix
echo "::remove-matcher owner=stylelint::"
test-python:
name: test-python-${{ matrix.name }}
needs: setup
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- { name: '3.9', python: '3.9', tox: py39 }
- { name: '3.10', python: '3.10', tox: py310 }
services:
postgres:
image: postgres:12
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432
options: --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 10
steps:
# BEGIN common steps - edit all occurrences if needed!
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 14.x
- name: Download environment
uses: actions/download-artifact@v3
with:
name: environment-${{ matrix.name }}
path: /tmp
- name: Restore environment
run: tar xf /tmp/env.tar
- name: Activate virtualenv for later steps
run: |
echo "VIRTUAL_ENV=$(pwd)/.venv" >> $GITHUB_ENV
echo "$(pwd)/.venv/bin" >> $GITHUB_PATH
- name: Install Indico
run: pip install -e .
# END common steps
- name: Install redis
run: sudo apt-get install redis-server
- name: Setup database
run: |
sudo apt-get update
sudo apt-get install postgresql-client libpq-dev
export PGHOST=localhost
export PGPORT=${{ job.services.postgres.ports[5432] }}
export PGUSER=postgres
createuser indicotest
createdb -O indicotest indicotest
psql indicotest -c 'CREATE EXTENSION unaccent;'
psql indicotest -c 'CREATE EXTENSION pg_trgm;'
- name: Run pytest tests
run: |
export INDICO_TEST_DATABASE_URI="postgresql://indicotest@localhost:${{ job.services.postgres.ports[5432] }}/indicotest"
pytest --color=yes
test-js:
needs: setup
runs-on: ubuntu-20.04
steps:
# BEGIN common steps - edit all occurrences if needed!
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 14.x
- name: Download environment
uses: actions/download-artifact@v3
with:
name: environment-3.10
path: /tmp
- name: Restore environment
run: tar xf /tmp/env.tar
- name: Activate virtualenv for later steps
run: |
echo "VIRTUAL_ENV=$(pwd)/.venv" >> $GITHUB_ENV
echo "$(pwd)/.venv/bin" >> $GITHUB_PATH
- name: Install Indico
run: pip install -e .
# END common steps
- name: Run jest tests
run: npm test
- name: Try building assets
run: python bin/maintenance/build-assets.py indico --dev