Update rand requirement from 0.8 to 0.10 in /glide-core #194
This file contains hidden or 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
| name: Rust tests | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - release-* | |
| - v* | |
| paths: | |
| - logger_core/** | |
| - glide-core/** | |
| - glide-core/redis-rs/redis/src/** | |
| - ffi/** | |
| - 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 | |
| - benchmarks/rust/** | |
| pull_request: | |
| paths: | |
| - logger_core/** | |
| - glide-core/** | |
| - glide-core/redis-rs/redis/src/** | |
| - ffi/** | |
| - 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 | |
| - benchmarks/rust/** | |
| workflow_dispatch: | |
| inputs: | |
| full-matrix: | |
| description: "Run the full engine and host matrix" | |
| type: boolean | |
| default: false | |
| run-with-macos: | |
| description: "Run with macos included (only when necessary)" | |
| type: choice | |
| options: | |
| - false | |
| - use-self-hosted | |
| - use-github | |
| default: false | |
| name: | |
| required: false | |
| type: string | |
| description: "(Optional) Test run name" | |
| workflow_call: | |
| inputs: | |
| run-with-macos: | |
| description: "Run with macos included (only when necessary)" | |
| type: string | |
| default: false | |
| 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' }} | |
| run-with-macos: ${{ github.event.inputs.run-with-macos }} | |
| tests: | |
| runs-on: ${{ matrix.host.RUNNER }} | |
| needs: get-matrices | |
| timeout-minutes: 25 | |
| 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: ${{ matrix.host.OS }} | |
| target: ${{ matrix.host.TARGET }} | |
| engine-version: ${{ matrix.engine.version }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| glide-core/target | |
| glide-core/src/generated | |
| key: ${{ matrix.host.TARGET }}-glide-core | |
| restore-keys: ${{ matrix.host.TARGET }} | |
| - name: Run glide-core tests | |
| working-directory: ./glide-core | |
| run: cargo test --features "proto,socket-layer,standalone_heartbeat" | |
| - name: Run glide-core telemetry tests | |
| working-directory: ./glide-core/telemetry | |
| run: cargo test --all-features -- --test-threads=1 | |
| # TODO: Remove `--test-threads=1` once https://github.com/valkey-io/valkey-glide/issues/4057 is resolved | |
| - name: Run glide-ffi tests | |
| working-directory: ./ffi | |
| run: cargo test | |
| - name: Run glide-ffi MIRI tests | |
| working-directory: ./ffi/miri-tests | |
| run: cargo miri test | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| glide-core/target | |
| glide-core/src/generated | |
| key: ${{ matrix.host.TARGET }}-logger_core | |
| - 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: actions/cache@v4 | |
| with: | |
| path: | | |
| glide-core/target | |
| glide-core/src/generated | |
| key: ${{ matrix.host.TARGET }}-benchmarks/rust | |
| restore-keys: | | |
| ${{ matrix.host.TARGET }}-glide-core | |
| ${{ matrix.host.TARGET }} | |
| - 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: ffi | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| name: lint glide-ffi | |
| - 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 |