Skip to content

Configure RubyLLM logger in R3x::Client::Llm #615

Configure RubyLLM logger in R3x::Client::Llm

Configure RubyLLM logger in R3x::Client::Llm #615

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: [main, "renovate/**"]
env:
OLD_VERSIONS_TO_KEEP: "10"
jobs:
scan_ruby:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Scan for common Rails security vulnerabilities using static analysis
run: bin/brakeman --no-pager
- name: Scan for known security vulnerabilities in gems used
run: bin/bundler-audit
agents_lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Lint AGENTS.md references
run: bin/lint-r3x
lint:
runs-on: ubuntu-latest
env:
RUBOCOP_CACHE_ROOT: tmp/rubocop
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Prepare RuboCop cache
uses: actions/cache@v6
env:
DEPENDENCIES_HASH: ${{ hashFiles('.ruby-version', '**/.rubocop.yml', '**/.rubocop_todo.yml', 'Gemfile.lock') }}
with:
path: ${{ env.RUBOCOP_CACHE_ROOT }}
key: rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-${{ github.ref_name == github.event.repository.default_branch && github.run_id || 'default' }}
restore-keys: |
rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-
- name: Lint code for consistent style
run: bin/rubocop -f github
lint_yaml:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Lint YAML for consistent style
uses: dprint/check@v2.3
test:
runs-on: ubuntu-latest
# services:
# redis:
# image: valkey/valkey:8
# ports:
# - 6379:6379
# options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run tests
env:
RAILS_ENV: test
# REDIS_URL: redis://localhost:6379/0
run: bin/rails db:test:prepare test
docker_validate:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Read Ruby version
id: ruby_version
run: echo "value=$(cat .ruby-version)" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build Docker target
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
target: ci
push: false
build-args: |
RUBY_VERSION=${{ steps.ruby_version.outputs.value }}
GIT_CODE_VERSION=${{ github.sha }}
cache-from: type=gha,scope=docker-ci
cache-to: type=gha,mode=max,scope=docker-ci
docker_publish:
if: github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
needs:
- scan_ruby
- agents_lint
- lint
- lint_yaml
- test
- docker_validate
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Read Ruby version
id: ruby_version
run: echo "value=$(cat .ruby-version)" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v6
with:
images: ghcr.io/${{ github.repository }}
tags: |
# stable release channel
type=raw,value=stable
# full length sha
type=sha,format=long,prefix=
- name: Build and push production image
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
target: production
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
RUBY_VERSION=${{ steps.ruby_version.outputs.value }}
GIT_CODE_VERSION=${{ github.sha }}
cache-from: type=gha,scope=docker-production
cache-to: type=gha,mode=max,scope=docker-production
- name: Delete old images
uses: actions/delete-package-versions@v5
with:
package-name: ${{ github.event.repository.name }}
package-type: "container"
min-versions-to-keep: ${{ env.OLD_VERSIONS_TO_KEEP }}
continue-on-error: true