Skip to content

Support sorting parameters in votes API endpoints #605

Support sorting parameters in votes API endpoints

Support sorting parameters in votes API endpoints #605

Workflow file for this run

name: Backend CI
on:
push:
branches: ["main"]
pull_request: {}
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
env:
# Make Python system packages (such as Xapian) accessible
PYTHONPATH: /usr/lib/python3/dist-packages
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install Xapian
run: sudo apt-get -y -q install python3-xapian
# Stopwords are included in the Alpine Xapian package, but for some reason they are not included
# in the Ubuntu package. This downloads them from the same source as the Alpine package:
# https://gitlab.alpinelinux.org/alpine/aports/-/blob/3.19-stable/community/xapian-core/APKBUILD#L12
- name: Download stopwords
working-directory: ${{ runner.temp }}
run: |
curl -o xapian-core-1.4.26.tar.xz https://oligarchy.co.uk/xapian/1.4.26/xapian-core-1.4.26.tar.xz
tar -xf xapian-core-1.4.26.tar.xz
mkdir -p /usr/share/xapian-core/stopwords
cp xapian-core-1.4.26/languages/stopwords/english.list /usr/share/xapian-core/stopwords/english.list
- name: Install poetry
run: pipx install "poetry<2.0"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "poetry"
cache-dependency-path: "./backend/poetry.lock"
- name: Install dependencies
run: poetry install
- name: Check formatting
run: make format-check
- name: Run linter
run: make lint
- name: Run types
run: make typecheck
- name: Run tests
run: make test
env:
HTV_BACKEND_DATABASE_URI: "sqlite:///${{ github.workspace }}/storage/database/database.sqlite3"
HTV_BACKEND_USERS_DATABASE_URI: "sqlite:///${{ github.workspace }}/storage/database/users.sqlite3"
HTV_SEARCH_INDEX_DIR: "${{ github.workspace }}/storage/index"