-
-
Notifications
You must be signed in to change notification settings - Fork 30
54 lines (51 loc) · 1.4 KB
/
test.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
name: test
on:
push:
branches:
- master
- release/**
pull_request:
jobs:
test:
name: Run tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python: ["3.8", "3.9", "3.10", "pypy-3.8"]
REDIS_VERSION: ["<3", "<4", "<5"]
env:
REDIS_VERSION: ${{ matrix.REDIS_VERSION }}
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install --editable .
- name: Install Redis
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update && sudo apt install redis-server --no-install-recommends -y
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install --quiet redis
else
echo "$RUNNER_OS not supported"
exit 1
fi
- name: Run tests
run: |
make test
collector:
needs: [test]
if: always()
runs-on: ubuntu-latest
steps:
- name: Check for failures
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1