From f33bed52f3f7553f635d1506b7d60fb716f26a9a Mon Sep 17 00:00:00 2001 From: Keshav Biswa Date: Mon, 31 Jul 2023 00:05:04 +0530 Subject: [PATCH] Create ci.yml (#10) * Create ci.yml * Update ci.yml * Update ci.yml * Update ci.yml * removed rubyversion * Added versions * f --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++++++++++++++ spec/dummy/Gemfile | 2 -- 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3c340ee --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + ruby: [ 3.0 ] + rails_version: + - ~> 5.2.0 + - ~> 6.0.0 + - ~> 6.1.0 + - ~> 7.0.0 + steps: + - uses: actions/checkout@v2 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + + - name: Install dependencies + run: | + gem install bundler + bundle install --jobs 4 --retry 3 + + - name: Setup DB + run: | + cd spec/dummy + bundle exec rake db:create db:migrate + env: + RAILS_ENV: test + + - name: Run tests + run: bundle exec rspec + env: + RAILS_VERSION: ${{ matrix.rails_version }} diff --git a/spec/dummy/Gemfile b/spec/dummy/Gemfile index 4d9e044..61b9733 100644 --- a/spec/dummy/Gemfile +++ b/spec/dummy/Gemfile @@ -1,8 +1,6 @@ source "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby "3.2.0" - # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" gem "rails", "~> 7.0.4", ">= 7.0.4.3"