-
Notifications
You must be signed in to change notification settings - Fork 77
80 lines (68 loc) · 2.44 KB
/
tests.yml
File metadata and controls
80 lines (68 loc) · 2.44 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Run test suite
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 60
name: "Python ${{ matrix.python-version }} / ${{ matrix.backend }}"
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
backend: ['redis', 'bitmapist-server']
steps:
- name: Checkout Repo
uses: actions/checkout@v5
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v6
with:
version: "latest"
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
uv sync --locked
- name: Install Redis
if: matrix.backend == 'redis'
run: |
sudo apt-get update
sudo apt-get install redis -y
- name: Get bitmapist-server latest version
if: matrix.backend == 'bitmapist-server'
id: bitmapist-version
run: |
VERSION=$(curl -s https://api.github.com/repos/Doist/bitmapist-server/releases/latest | jq -r .tag_name)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Cache bitmapist-server
if: matrix.backend == 'bitmapist-server'
id: cache-bitmapist
uses: actions/cache@v4
with:
path: ~/bitmapist-server
key: bitmapist-server-${{ steps.bitmapist-version.outputs.version }}
- name: Download bitmapist-server
if: matrix.backend == 'bitmapist-server' && steps.cache-bitmapist.outputs.cache-hit != 'true'
run: |
wget https://github.com/Doist/bitmapist-server/releases/latest/download/bitmapist-server-linux-amd64.tar.gz
tar -xzf bitmapist-server-linux-amd64.tar.gz
chmod +x bitmapist-server
mv bitmapist-server ~/bitmapist-server
- name: Install bitmapist-server
if: matrix.backend == 'bitmapist-server'
run: |
sudo cp ~/bitmapist-server /usr/local/bin/bitmapist-server
sudo chmod +x /usr/local/bin/bitmapist-server
- name: Verify Redis is available
if: matrix.backend == 'redis'
run: |
command -v redis-server || exit 1
redis-server --version
- name: Verify bitmapist-server is available
if: matrix.backend == 'bitmapist-server'
run: |
command -v bitmapist-server || exit 1
bitmapist-server --version
- name: Run tests
run: uv run pytest -vv