Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,24 @@ jobs:
with:
python-version: '3.10'

- name: Install Clang (for bindgen)
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
sudo apt-get update
sudo apt-get install -y libclang-dev
elif [[ "${{ runner.os }}" == "macOS" ]]; then
# Install LLVM which provides libclang
brew install llvm
# Set environment variables for bindgen to find libclang
echo "LIBCLANG_PATH=$(brew --prefix llvm)/lib" >> $GITHUB_ENV
echo "LLVM_CONFIG_PATH=$(brew --prefix llvm)/bin/llvm-config" >> $GITHUB_ENV
fi

- name: Install toolchain
id: tc
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
components: rustfmt, clippy

- name: Setup cache
Expand All @@ -80,22 +91,22 @@ jobs:
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-test-${{ steps.tc.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.toml') }}
key: ${{ runner.os }}-test-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.toml') }}

- name: Format
run: cargo fmt --all -- --check

- name: Clippy
run: cargo clippy --all-targets --no-default-features --features "bindgen/runtime min-redis-compatibility-version-${{ matrix.redis-version[0] }}"
run: cargo clippy --all-targets --no-default-features --features min-redis-compatibility-version-${{ matrix.redis-version[0] }},bindgen-runtime

- name: Build debug
run: cargo build --no-default-features --features "bindgen/runtime min-redis-compatibility-version-${{ matrix.redis-version[0] }}"
run: cargo build --no-default-features --features min-redis-compatibility-version-${{ matrix.redis-version[0] }},bindgen-runtime

- name: Build release
run: cargo build --release --no-default-features --features "bindgen/runtime min-redis-compatibility-version-${{ matrix.redis-version[0] }}"
run: cargo build --release --no-default-features --features min-redis-compatibility-version-${{ matrix.redis-version[0] }},bindgen-runtime

- name: Test
run: cargo test --no-default-features --features "bindgen/runtime min-redis-compatibility-version-${{ matrix.redis-version[0] }}"
run: cargo test --no-default-features --features min-redis-compatibility-version-${{ matrix.redis-version[0] }},bindgen-runtime

- name: Doc
run: cargo doc --no-default-features --features "all-features-but-xor bindgen/runtime min-redis-compatibility-version-${{ matrix.redis-version[0] }}"
15 changes: 6 additions & 9 deletions .github/workflows/cratesio-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

- name: get version from tag
id: get_version
run: |
realversion="${GITHUB_REF/refs\/tags\//}"
realversion="${realversion//v/}"
echo "::set-output name=VERSION::$realversion"
echo "VERSION=$realversion" >> $GITHUB_OUTPUT

- name: Set the version for publishing
uses: ciiiii/toml-editor@1.0.0
Expand Down Expand Up @@ -50,20 +47,20 @@ jobs:
value: "${{ steps.get_version.outputs.VERSION }}"

- name: Publishing redismodule-rs-macros-internals
uses: katyo/publish-crates@v1
uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
path: './redismodule-rs-macros-internals'
args: --allow-dirty

- name: Publishing redismodule-rs
uses: katyo/publish-crates@v1
uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
args: --allow-dirty

- name: Publishing redismodule-rs-macros
uses: katyo/publish-crates@v1
uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
path: './redismodule-rs-macros'
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/test-registry-token.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test Registry Token

on:
workflow_dispatch: # Manual trigger only

jobs:
test-token:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Test registry token login
run: |
echo "Testing cargo login with registry token..."
# Use environment variable to avoid any risk of token exposure
echo "$CARGO_REGISTRY_TOKEN" | cargo login
echo "✅ Registry token login successful"
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ min-redis-compatibility-version-7-0 = ["redis-module/min-redis-compatibility-ver
min-redis-compatibility-version-6-2 = ["redis-module/min-redis-compatibility-version-6-2"]
min-redis-compatibility-version-6-0 = ["redis-module/min-redis-compatibility-version-6-0"]

# Enable static linking to libclang in bindgen
# Enable static linking to libclang in bindgen (overrides runtime)
bindgen-static = ["bindgen/static"]
# Enable dynamic linking to libclang in bindgen
# Enable dynamic linking to libclang in bindgen (default)
bindgen-runtime = ["bindgen/runtime"]

# List all features here, that are not in a exclusive or relationship
Expand Down