Skip to content

Feature/replace credes #3582

Feature/replace credes

Feature/replace credes #3582

Workflow file for this run

name: Rust tests
on:
push:
branches:
- main
- release-*
- v*
paths:
- logger_core/**
- glide-core/**
- glide-core/redis-rs/redis/src/**
- utils/cluster_manager.py
- .github/workflows/rust.yml
- .github/workflows/install-shared-dependencies/action.yml
- .github/workflows/install-engine/action.yml
- .github/workflows/lint-rust/action.yml
- .github/workflows/create-test-matrices/action.yml
- .github/json_matrices/**
- deny.toml
pull_request:
paths:
- logger_core/**
- glide-core/**
- glide-core/redis-rs/redis/src/**
- utils/cluster_manager.py
- .github/workflows/rust.yml
- .github/workflows/install-shared-dependencies/action.yml
- .github/workflows/install-engine/action.yml
- .github/workflows/lint-rust/action.yml
- .github/workflows/create-test-matrices/action.yml
- .github/json_matrices/**
- deny.toml
workflow_dispatch:
inputs:
full-matrix:
description: "Run the full engine and host matrix"
type: boolean
default: false
name:
required: false
type: string
description: "(Optional) Test run name"
workflow_call:
concurrency:
group: rust-${{ github.head_ref || github.ref }}-${{ toJson(inputs) }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
run-name:
# Set custom name if job is started manually and name is given
${{ github.event_name == 'workflow_dispatch' && (inputs.name == '' && format('{0} @ {1} {2}', github.ref_name, github.sha, toJson(inputs)) || inputs.name) || '' }}
jobs:
get-matrices:
runs-on: ubuntu-latest
# Avoid running on schedule for forks
if: (github.repository_owner == 'valkey-io' || github.event_name != 'schedule') || github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
outputs:
engine-matrix-output: ${{ steps.get-matrices.outputs.engine-matrix-output }}
host-matrix-output: ${{ steps.get-matrices.outputs.host-matrix-output }}
# language version matrix is omitted
steps:
- uses: actions/checkout@v4
- id: get-matrices
uses: ./.github/workflows/create-test-matrices
with:
language-name: rust
# Run full test matrix if job started by cron or it was explictly specified by a person who triggered the workflow
run-full-matrix: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }}
tests:
runs-on: ${{ matrix.host.RUNNER }}
needs: get-matrices
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
engine: ${{ fromJson(needs.get-matrices.outputs.engine-matrix-output) }}
host: ${{ fromJson(needs.get-matrices.outputs.host-matrix-output) }}
steps:
- 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: ${{ matrix.engine.version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: Swatinem/rust-cache@v2
- name: Run tests
working-directory: ./glide-core
run: cargo test --all-features --release -- --test-threads=1 # TODO remove the concurrency limit after we fix test flakyness.
- name: Run logger tests
working-directory: ./logger_core
run: cargo test --all-features -- --test-threads=1
- name: Check features
working-directory: ./glide-core
run: |
cargo check --benches --all-features
cargo check --no-default-features
- uses: ./.github/workflows/test-benchmark
with:
language-flag: -rust
lint:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/lint-rust
with:
cargo-toml-folder: ./glide-core
github-token: ${{ secrets.GITHUB_TOKEN }}
name: lint glide-core
- uses: ./.github/workflows/lint-rust
with:
cargo-toml-folder: ./logger_core
github-token: ${{ secrets.GITHUB_TOKEN }}
name: lint logger
- uses: ./.github/workflows/lint-rust
with:
cargo-toml-folder: ./benchmarks/rust
github-token: ${{ secrets.GITHUB_TOKEN }}
name: lint benchmark