Skip to content

Disable loaders and use app_dirs instead #15

Disable loaders and use app_dirs instead

Disable loaders and use app_dirs instead #15

Workflow file for this run

name: Froide CI
on:
push:
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[lint]
yarn install
- name: Run flake8
run: flake8 froide --statistics
- name: Run black
run: black --check froide
- name: Run isort
run: isort --check froide
- name: Run eslint
run: yarn lint
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.10']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install system-level dependencies
run: sudo apt-get update && sudo apt-get install libxml2-dev libxslt1-dev python3-dev libgdal-dev gdal-bin libmagic-dev libmagickwand-dev libpoppler-cpp-dev
- name: Install dependencies
run: |
python -m pip install --upgrade pip~=22.0.1 pip-tools
pip-sync requirements-test.txt
pip install -e .
yarn install
- name: Build frontend
run: yarn run build
- name: Run flake8 and tests
run: make testci
env:
DATABASE_URL: postgis://postgres:postgres@localhost/froide
services:
postgres:
image: postgis/postgis:14-3.3
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: froide
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.3
options: -e "discovery.type=single-node" -e "xpack.security.enabled=false" --expose 9200 --health-cmd "curl localhost:9200/_cluster/health" --health-interval 10s --health-timeout 5s --health-retries 10
ports:
- '9200:9200'
testui:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install system-level dependencies
run: sudo apt-get update && sudo apt-get install libxml2-dev libxslt1-dev python3-dev libgdal-dev gdal-bin python3-gdal libmagic-dev libmagickwand-dev libpoppler-cpp-dev
- name: Install dependencies
run: |
python -m pip install --upgrade pip~=22.0.1 pip-tools
pip-sync requirements-test.txt
playwright install --with-deps chromium
pip install -e .
yarn install
- name: Build frontend
run: yarn run build
- name: Run in-browser tests
run: make testui
env:
DATABASE_URL: postgis://postgres:postgres@localhost/froide
DJANGO_TEST_SELENIUM_DRIVER: http://localhost:4444/wd/hub#chrome_headless
services:
postgres:
image: postgis/postgis:12-3.0
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: froide
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.3
options: -e "discovery.type=single-node" -e "xpack.security.enabled=false" --expose 9200 --health-cmd "curl localhost:9200/_cluster/health" --health-interval 10s --health-timeout 5s --health-retries 10
ports:
- '9200:9200'