-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: avifenesh <aviarchi1994@gmail.com>
- Loading branch information
Showing
8 changed files
with
125 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,123 +1,124 @@ | ||
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: | ||
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 | ||
group: redis-rs-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
redis-rs-CI: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo | ||
glide-core/redis-rs/redis/src/target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo- | ||
- name: Cache cargo index | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
glide-core/redis-rs/redis/src/target | ||
~/.cargo/git | ||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-index- | ||
- name: Cache cargo build | ||
uses: actions/cache@v2 | ||
with: | ||
path: glide-core/redis-rs/redis/src/target | ||
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-build- | ||
- name: Install shared software dependencies | ||
uses: ./.github/workflows/install-shared-dependencies | ||
with: | ||
os: "ubuntu" | ||
target: "x86_64-unknown-linux-gnu" | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build project | ||
run: cargo build --release | ||
|
||
- name: Test | ||
run: cargo test --release -- --nocapture --test-threads=1 | ||
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 | ||
path: | | ||
glide-core/redis-rs/redis/src/target/debug/deps/*.d | ||
glide-core/redis-rs/redis/src/target/debug/deps/*.json | ||
- name: Run benchmarks | ||
run: cargo bench | ||
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 | ||
path: | | ||
glide-core/redis-rs/redis/src/target/criterion/** | ||
- name: Test docs | ||
run: cargo test --doc | ||
working-directory: ./glide-core/redis-rs/redis/src | ||
|
||
- name: Security audit | ||
run: cargo audit | ||
working-directory: ./glide-core/redis-rs/redis | ||
|
||
- name: Run cargo machete | ||
run: | | ||
cargo install cargo-machete | ||
cargo machete | ||
working-directory: ./glide-core/redis-rs/redis | ||
|
||
- name: Lint redis-rs | ||
uses: ./.github/workflows/lint-rust | ||
with: | ||
cargo-toml-folder: ./glide-core/redis-rs | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
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 | ||
working-directory: ./glide-core/redis-rs/redis | ||
|
||
- name: Test | ||
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 | ||
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 | ||
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" | ||
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: 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 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.