-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1011 Bytes
/
Copy pathrust.yml
File metadata and controls
50 lines (42 loc) · 1011 Bytes
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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test
runs-on: ubuntu-latest
services:
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Install Redis CLI
run: sudo apt-get update && sudo apt-get install -y redis-tools
- name: Wait for Redis
run: |
for i in {1..10}; do
if redis-cli -h localhost ping; then
echo "Redis is ready"
exit 0
fi
echo "Waiting for Redis... attempt $i"
sleep 5
done
echo "Redis failed to start"
exit 1
- name: Run tests with Redis
run: cargo test --verbose -- --nocapture
env:
REDIS_URL: redis://localhost:6379