diff --git a/.github/services/redis/redis_tls/action.yml b/.github/services/redis/redis_tls/action.yml new file mode 100644 index 000000000000..0e500be4efcd --- /dev/null +++ b/.github/services/redis/redis_tls/action.yml @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name: redis_tls +description: 'Behavior test for redis tls' + +runs: + using: "composite" + steps: + - uses: actions/checkout@v4 + + - name: Setup Redis with TLS + shell: bash + working-directory: fixtures/redis + run: | + # Install the CA in the system + sudo cp ssl/ca.crt /usr/local/share/ca-certificates + sudo update-ca-certificates + + docker compose -f docker-compose-redis-tls.yml up -d --wait + - name: Setup + shell: bash + run: | + cat << EOF >> $GITHUB_ENV + OPENDAL_REDIS_ENDPOINT=rediss://127.0.0.1:6379 + OPENDAL_REDIS_ROOT=/ + OPENDAL_REDIS_DB=0 + EOF diff --git a/.github/services/redis/redis_with_cluster_tls/action.yml b/.github/services/redis/redis_with_cluster_tls/action.yml new file mode 100644 index 000000000000..e01335c279a2 --- /dev/null +++ b/.github/services/redis/redis_with_cluster_tls/action.yml @@ -0,0 +1,46 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name: redis_with_cluster_tls +description: 'Behavior test for redis with cluster tls' + +runs: + using: "composite" + steps: + - uses: actions/checkout@v4 + + - name: Setup Redis Cluster with TLS + shell: bash + working-directory: fixtures/redis + run: | + + # Install the CA in the system + + sudo cp ssl/ca.crt /usr/local/share/ca-certificates + sudo update-ca-certificates + + docker compose -f docker-compose-redis-cluster-tls.yml up -d --wait + + - name: Setup + shell: bash + run: | + cat << EOF >> $GITHUB_ENV + OPENDAL_REDIS_CLUSTER_ENDPOINTS=rediss://127.0.0.1:6380/,rediss://127.0.0.1:6381/,rediss://127.0.0.1:6382/,rediss://127.0.0.1:6383/,rediss://127.0.0.1:6384/,rediss://127.0.0.1:6385/ + OPENDAL_REDIS_ROOT=/test/opendal + OPENDAL_REDIS_DB=0 + OPENDAL_REDIS_PASSWORD=opendal + EOF diff --git a/.github/workflows/service_test_redis.yml b/.github/workflows/service_test_redis.yml deleted file mode 100644 index 89eaeb44ab48..000000000000 --- a/.github/workflows/service_test_redis.yml +++ /dev/null @@ -1,103 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -name: Service Test Redis - -on: - push: - branches: - - main - pull_request: - branches: - - main - paths: - - "core/src/**" - - "core/tests/**" - - "!core/src/docs/**" - - "!core/src/services/**" - - "core/src/services/redis/**" - - "bindings/java/**" - - ".github/workflows/service_test_redis.yml" - - "fixtures/redis/**" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} - cancel-in-progress: true - -jobs: - redis-tls: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup Redis with TLS - shell: bash - working-directory: fixtures/redis - run: | - # Install the CA in the system - sudo cp ssl/ca.crt /usr/local/share/ca-certificates - sudo update-ca-certificates - - docker-compose -f docker-compose-redis-tls.yml up -d - - - name: Setup Rust toolchain - uses: ./.github/actions/setup - with: - need-nextest: true - - name: Test - shell: bash - working-directory: core - run: cargo nextest run behavior --features tests,services-redis - env: - OPENDAL_TEST: redis - OPENDAL_REDIS_ENDPOINT: rediss://localhost:6379 - OPENDAL_REDIS_ROOT: / - OPENDAL_REDIS_DB: 0 - - redis-cluster-tls: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Setup Redis Cluster with TLS - shell: bash - working-directory: fixtures/redis - run: | - - # Install the CA in the system - - sudo cp ssl/ca.crt /usr/local/share/ca-certificates - sudo update-ca-certificates - - docker-compose -f docker-compose-redis-cluster-tls.yml up -d - - - name: Setup Rust toolchain - uses: ./.github/actions/setup - with: - need-nextest: true - - - name: Test - shell: bash - working-directory: core - run: cargo nextest run behavior --features tests,services-redis - env: - OPENDAL_TEST: redis - OPENDAL_REDIS_CLUSTER_ENDPOINTS: rediss://127.0.0.1:6380/,rediss://127.0.0.1:6381/,rediss://127.0.0.1:6382/,rediss://127.0.0.1:6383/,rediss://127.0.0.1:6384/,rediss://127.0.0.1:6385/ - OPENDAL_REDIS_PASSWORD: opendal - OPENDAL_REDIS_ROOT: /test/opendal - OPENDAL_REDIS_DB: 0