blob: fed4285270ffc403ee2d454abe9d43d297ce19d4 [file]
# 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: Behavior Test Binding Ruby
on:
workflow_call:
inputs:
os:
required: true
type: string
cases:
required: true
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
defaults:
run:
working-directory: bindings/ruby
jobs:
test_base:
name: base
runs-on: ${{ inputs.os }}
strategy:
fail-fast: false
matrix:
ruby-version: ["3.2", "3.3", "3.4", "4.0"]
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ github.workspace }}/bindings/ruby/Gemfile
steps:
- uses: actions/checkout@v7
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
need-protoc: true
need-rocksdb: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Ruby and install dependencies
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
working-directory: bindings/ruby # must repeat because GitHub Actions will not use defaults.run
- name: Test base
run: |
bundle exec rake test:base
test_service:
name: ${{ matrix.cases.service }} / ${{ matrix.cases.setup }}
needs: test_base
runs-on: ${{ inputs.os }}
strategy:
fail-fast: false
matrix:
cases: ${{ fromJson(inputs.cases) }}
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ github.workspace }}/bindings/ruby/Gemfile
steps:
- uses: actions/checkout@v7
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
need-protoc: true
need-rocksdb: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup 1Password Connect
shell: bash
run: |
echo "::add-mask::${{ secrets.OP_CONNECT_HOST }}"
echo "::add-mask::${{ secrets.OP_CONNECT_TOKEN }}"
echo "OP_CONNECT_HOST=${{ secrets.OP_CONNECT_HOST }}" >> "$GITHUB_ENV"
echo "OP_CONNECT_TOKEN=${{ secrets.OP_CONNECT_TOKEN }}" >> "$GITHUB_ENV"
- name: Setup Ruby and install dependencies
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
working-directory: bindings/ruby # must repeat because GitHub Actions will not use defaults.run
- name: Test service
uses: ./.github/actions/test_behavior_binding_ruby
with:
setup: ${{ matrix.cases.setup }}
service: ${{ matrix.cases.service }}
feature: ${{ matrix.cases.feature }}