From 8e05b9fa107cafc46500c67c4be252063c573152 Mon Sep 17 00:00:00 2001 From: Justin Harris Date: Fri, 26 Jun 2026 15:57:23 -0400 Subject: [PATCH] Add CI --- .circleci/config.yml | 46 ---------------------------------------- .github/workflows/ci.yml | 38 +++++++++++++++++++++++++++++++++ README.md | 2 +- 3 files changed, 39 insertions(+), 47 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 571a10d5..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,46 +0,0 @@ -version: 2.1 # Use 2.1 to enable using orbs and other features. - -# Declare the orbs that we'll use in our config. -orbs: - ruby: circleci/ruby@1.0 - -jobs: - rubocop: - parallelism: 1 - docker: - - image: cimg/ruby:3.2-node - steps: - - checkout - - ruby/install-deps - - run: - name: Run Rubocop - command: bundle exec rubocop - test: - parameters: - ruby-image: - type: string - parallelism: 1 - docker: - - image: << parameters.ruby-image >> - steps: - - checkout - - ruby/install-deps - - run: - name: Run tests - command: bundle exec rspec -fd - -workflows: - version: 2 - checks: - jobs: - - rubocop - - test: - matrix: - parameters: - ruby-image: - - cimg/ruby:2.7-node - - cimg/ruby:3.0-node - - cimg/ruby:3.1-node - - cimg/ruby:3.2-node - - cimg/ruby:3.3-node - - cimg/ruby:3.4-node diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..2ccf6743 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: CI + +on: + push: + branches: [ "main" ] + paths: + - ".github/workflows/ruby_build_test.yml" + - "ruby/**" + - "rust/optify/**" + - "tests/**" + pull_request: + branches: [ "main" ] + types: [ opened, synchronize, reopened, ready_for_review ] + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: "Build" + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v7 + + # setup-ruby also runs `bundle install`. + # It uses the Ruby version from .ruby-version. + - name: "Setup" + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: "Run tests and lint" + run: bundle exec rake diff --git a/README.md b/README.md index 3039f59c..3d451c65 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This project is mainly intended for a small patch for our team until we can migr [![Gem Version](https://img.shields.io/gem/v/ruby-openai.svg)](https://rubygems.org/gems/ruby-openai) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Shopify/ruby-openai/blob/main/LICENSE.txt) -[![CircleCI Build Status](https://circleci.com/gh/alexrudall/ruby-openai.svg?style=shield)](https://circleci.com/gh/alexrudall/ruby-openai) +[![CI](https://github.com/Shopify/ruby-openai/actions/workflows/ci.yml/badge.svg)](https://github.com/Shopify/ruby-openai/actions/workflows/ci.yml) Use the [OpenAI API](https://openai.com/blog/openai-api/) with Ruby! 🤖❤️