-
Notifications
You must be signed in to change notification settings - Fork 64
142 lines (124 loc) · 5.62 KB
/
redis-rs.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Redis-rs CI
on:
push:
branches:
- main
- release-*
- v*
paths:
- glide-core/redis-rs/redis/**
- utils/cluster_manager.py
- deny.toml
- .github/workflows/install-shared-dependencies/action.yml
- .github/workflows/redis-rs.yml
pull_request:
paths:
- glide-core/redis-rs/redis/**
- utils/cluster_manager.py
- deny.toml
- .github/workflows/install-shared-dependencies/action.yml
- .github/workflows/redis-rs.yml
workflow_dispatch:
workflow_call:
concurrency:
group: redis-rs-${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
redis-rs-CI:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install shared software dependencies
uses: ./.github/workflows/install-shared-dependencies
with:
os: "ubuntu"
target: "x86_64-unknown-linux-gnu"
engine-version: "7.2.5"
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
workspaces: ./glide-core/redis-rs/redis
- name: Build project
run: cargo build --release
working-directory: ./glide-core/redis-rs/redis/src
- name: Lint redis-rs
shell: bash
run: |
cargo fmt --all -- --check
cargo clippy -- -D warnings
cargo install --locked cargo-deny
cargo deny check all --config ${GITHUB_WORKSPACE}/deny.toml --exclude-dev all
working-directory: ./glide-core/redis-rs/redis
- name: Test
# TODO remove the concurrency limit after we fix test flakyness.
run: |
cargo test --release -- --test-threads=1 | tee ../test-results.xml
echo "### Tests passed :v:" >> $GITHUB_STEP_SUMMARY
working-directory: ./glide-core/redis-rs/redis/src
- name: Upload test reports
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: test-reports-redis-rs-${{ github.sha }}
path: ./glide-core/redis-rs/redis/test-results.xml
- name: Run benchmarks
run: |
cargo bench | tee bench-results.xml
working-directory: ./glide-core/redis-rs/redis
- name: Upload benchmark results
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: benchmark-results-redis-rs-${{ github.sha }}
path: ./glide-core/redis-rs/redis/bench-results.xml
- name: Test docs
run: |
cargo test --doc
working-directory: ./glide-core/redis-rs/redis/src
- name: Security audit
run: |
cargo audit | tee audit-results.txt
if grep -q "Crate: " audit-results.txt; then
echo "## Security audit results summary: Security vulnerabilities found :exclamation: :exclamation:" >> $GITHUB_STEP_SUMMARY
echo "Security audit results summary: Security vulnerabilities found"
exit 1
else
echo "### Security audit results summary: All good, no security vulnerabilities found :closed_lock_with_key:" >> $GITHUB_STEP_SUMMARY
echo "Security audit results summary: All good, no security vulnerabilities found"
fi
working-directory: ./glide-core/redis-rs/redis
- name: Upload audit results
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: audit-results-redis-rs--${{ github.sha }}
path: ./glide-core/redis-rs/redis/audit-results.txt
- name: Run cargo machete
run: |
cargo install cargo-machete
cargo machete | tee machete-results.txt
if grep -A1 "cargo-machete found the following unused dependencies in this directory:" machete-results.txt | sed -n '2p' | grep -v "^if" > /dev/null; then
echo "Machete results summary: Unused dependencies found" >> $GITHUB_STEP_SUMMARY
echo "Machete results summary: Unused dependencies found"
cat machete-results.txt | grep -A1 "cargo-machete found the following unused dependencies in this directory:" | sed -n '2p' | grep -v "^if" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo "### Machete results summary: All good, no unused dependencies found :rocket:" >> $GITHUB_STEP_SUMMARY
echo "Machete results summary: All good, no unused dependencies found"
fi
working-directory: ./glide-core/redis-rs/redis
- name: Upload machete results
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: machete-results-redis-rs-${{ github.sha }}
path: ./glide-core/redis-rs/redis/machete-results.txt