From ad8a6abd3296feb053627847b562ce6e64071652 Mon Sep 17 00:00:00 2001 From: Adam Rice Date: Sat, 11 Nov 2023 14:06:30 +1100 Subject: [PATCH] Configure GitHub Actions as CI --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++++++++++++++++ .rubocop.yml | 5 ++++- Gemfile.lock | 4 ++++ cohousing.gemspec | 2 +- 4 files changed, 46 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..387eb47 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +name: CI +on: [push] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: ["3.1", "3.2"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Ruby ${{ matrix.ruby }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + + - name: Install Appraisal dependencies + run: bundle exec appraisal install + + - name: Appraise Rails 6.1 + run: bundle exec appraisal rails-6.1 rspec + + - name: Appraise Rails 7.0 + run: bundle exec appraisal rails-7.0 rspec + + - name: Appraise Rails 7.1 + run: bundle exec appraisal rails-7.1 rspec + + - name: Appraise Rails Edge + run: bundle exec appraisal rails-edge rspec + + - name: Lint with Rubocop + run: bundle exec rubocop diff --git a/.rubocop.yml b/.rubocop.yml index 2f2eef5..311836c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,10 +7,13 @@ Rails: Enabled: true AllCops: - TargetRubyVersion: 2.5 + TargetRubyVersion: 3.1 Exclude: - Rakefile - bin/**/* + - gemfiles/**/* + - spec/dummy/db/schema.rb + - vendor/bundle/**/* NewCops: enable Layout/DotPosition: diff --git a/Gemfile.lock b/Gemfile.lock index 7ad5f86..a1517e5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -140,6 +140,8 @@ GEM nio4r (2.5.9) nokogiri (1.15.4-arm64-darwin) racc (~> 1.4) + nokogiri (1.15.4-x86_64-linux) + racc (~> 1.4) parallel (1.23.0) parser (3.2.2.4) ast (~> 2.4.1) @@ -246,6 +248,7 @@ GEM ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) sqlite3 (1.6.8-arm64-darwin) + sqlite3 (1.6.8-x86_64-linux) stringio (3.0.9) thor (1.3.0) timeout (0.4.1) @@ -260,6 +263,7 @@ GEM PLATFORMS arm64-darwin-22 + x86_64-linux DEPENDENCIES appraisal! diff --git a/cohousing.gemspec b/cohousing.gemspec index 12638dc..0e560b0 100644 --- a/cohousing.gemspec +++ b/cohousing.gemspec @@ -11,7 +11,7 @@ Gem::Specification.new do |spec| spec.summary = "A security-first approach to tenanting a Ruby on Rails application" spec.license = "MIT" - spec.required_ruby_version = ">= 2.5.0" + spec.required_ruby_version = ">= 3.1.0" spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = "https://github.com/HashNotAdam/cohousing"