-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (50 loc) · 1.86 KB
/
backend.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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
- 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_SEARCH_INDEX_DIR: "${{ github.workspace }}/storage/index"