Skip to content
Merged
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
41 changes: 35 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,53 @@ on:
push:
branches:
- main

pull_request:

workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- '3.2.3'
os: [ubuntu-latest, macos-latest, windows-latest]
ruby: ['3.2.3']

runs-on: ${{ matrix.os }}
name: Ruby ${{ matrix.ruby }} on ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}

- name: Install TA-Lib on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
mkdir -p ta-lib
wget -P ta-lib https://github.com/ta-lib/ta-lib/releases/download/v0.6.4/ta-lib_0.6.4_amd64.deb
sudo dpkg -i ta-lib/ta-lib_0.6.4_amd64.deb

- name: Install TA-Lib on macOS
if: matrix.os == 'macos-latest'
run: brew install ta-lib

- name: Install TA-Lib on Windows
if: matrix.os == 'windows-latest'
run: |
Invoke-WebRequest -Uri "https://github.com/ta-lib/ta-lib/releases/download/v0.6.4/ta-lib-0.6.4-windows-x86_64.msi" -OutFile "ta-lib.msi"
msiexec /i ta-lib.msi /quiet /norestart

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Run the default task
run: bundle exec rake
26 changes: 26 additions & 0 deletions .github/workflows/pr_agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: PR Agent
on:
pull_request:
types: [opened, reopened, ready_for_review, review_requested]
issue_comment:
jobs:
pr_agent_job:
if: ${{ github.event.sender.type != 'Bot' }}
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
contents: write
name: Run pr agent on every pull request, respond to user comments
steps:
- name: PR Agent action step
id: pragent
uses: Codium-ai/pr-agent@main
env:
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
github_action_config.auto_review: "true" # enable\disable auto review
github_action_config.auto_describe: "true" # enable\disable auto describe
github_action_config.auto_improve: "true" # enable\disable auto improve
github_action_config.pr_actions: '["opened", "reopened", "ready_for_review", "review_requested"]'
11 changes: 11 additions & 0 deletions .pr_agent.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[config]
model="deepseek/deepseek-chat"
fallback_models=["deepseek/deepseek-chat"]
custom_model_max_tokens=64000
max_model_tokens=64000

[github_action_config]
# auto_review = true # set as env var in .github/workflows/pr-agent.yaml
# auto_describe = true # set as env var in .github/workflows/pr-agent.yaml
# auto_improve = true # set as env var in .github/workflows/pr-agent.yaml
# pr_actions = ['opened', 'reopened', 'ready_for_review', 'review_requested']
4 changes: 0 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ GEM
specs:
ast (2.4.2)
byebug (11.1.3)
debase (0.2.8)
debase-ruby_core_source (>= 3.3.6)
debase-ruby_core_source (3.4.1)
diff-lcs (1.5.1)
fiddle (1.1.6)
json (2.9.1)
Expand Down Expand Up @@ -74,7 +71,6 @@ PLATFORMS

DEPENDENCIES
byebug (~> 11.1)
debase (~> 0.2.8)
rake (~> 13.2)
rspec (~> 3.13)
rubocop-rspec (~> 3.3)
Expand Down
15 changes: 14 additions & 1 deletion lib/ta_lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@ module TALib
VERSION = "0.1.0".freeze

extend Fiddle::Importer
dlload "libta-lib.so"

lib_path = case RUBY_PLATFORM
when /darwin/
brew_prefix = `brew --prefix`.chomp
"#{brew_prefix}/lib/libta-lib.dylib"
when /linux/
"libta-lib.so"
when /win32|mingw32/
"C:/Program Files/TA-Lib/bin/ta-lib.dll"
else
raise "Unsupported platform"
end

dlload lib_path

class TALibError < StandardError; end

Expand Down
3 changes: 1 addition & 2 deletions ta_lib_ffi.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_development_dependency "byebug", "~> 11.1"
spec.add_development_dependency "debase", "~> 0.2.8"
spec.add_dependency "fiddle", "~> 1.1"
spec.add_development_dependency "byebug", "~> 11.1"
spec.add_development_dependency "rake", "~> 13.2"
spec.add_development_dependency "rspec", "~> 3.13"
spec.add_development_dependency "rubocop-rspec", "~> 3.3"
Expand Down
Loading