Skip to content

Commit

Permalink
Move to github workflows
Browse files Browse the repository at this point in the history
This commit moves CI from circle to gh workflow. We also add a test for rails
main that is currently failing. I think its a binstub issue, and I'll look into this
later, but merging this anyway still seems valuable.
  • Loading branch information
jho406 committed Apr 15, 2024
1 parent c1d2b77 commit a8a901e
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 23 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build_js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test superglue_js
on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
name: Test superglue.js
strategy:
fail-fast: false

runs-on: 'ubuntu-latest'

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup project
working-directory: ./superglue
run: npm install
- name: Lint
working-directory: ./superglue
run: npm run lint
- name: Test
working-directory: ./superglue
run: npm run test
40 changes: 40 additions & 0 deletions .github/workflows/build_rails.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test superglue_rails
on:
push:
pull_request:
schedule:
- cron: '* * * * 1'
workflow_dispatch:

jobs:
build:
name: Ruby ${{ matrix.ruby }}. Rails ${{ matrix.version }}
strategy:
fail-fast: false
matrix:
ruby: ['3.3', '3.2', '3.1']
version: ['70', '71', 'main']

runs-on: 'ubuntu-latest'

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Setup project
working-directory: ./superglue_rails
run: |
mv Gemfile.${{ matrix.version }} Gemfile
bundle install
bundle update
- name: Run unit test
working-directory: ./superglue_rails
run: bundle exec rake test
- name: Run acceptance test
working-directory: ./superglue_rails
run: BUNDLE_GEMFILE='' ruby -Ilib:test test/acceptance/superglue_installation_acceptance.rb

13 changes: 9 additions & 4 deletions superglue_rails/Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
source "https://rubygems.org"
source 'https://rubygems.org'
gemspec

gem "rails", "~> 7.0.0"
gem "props_template"
gem "standard"
gem 'rails', git: 'https://github.com/rails/rails', ref: 'main'
gem 'selenium-webdriver'
gem 'props_template'
gem 'standard'
gem 'capybara'
gem 'minitest'
gem 'rake'
gem 'sqlite3'
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@ source 'https://rubygems.org'
gemspec

gem 'rails', '~> 7.1.0'
gem 'selenium-webdriver'
gem 'props_template'
gem 'standard'
gem 'capybara'
gem 'minitest'
gem 'rake'
gem 'sqlite3'
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@ source 'https://rubygems.org'
gemspec

gem 'rails', '~> 7.0.0'
gem 'selenium-webdriver'
gem 'props_template'
gem 'standard'
gem 'capybara'
gem 'minitest'
gem 'rake'
gem 'sqlite3'
11 changes: 11 additions & 0 deletions superglue_rails/Gemfile.main
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source 'https://rubygems.org'
gemspec

gem 'rails', git: 'https://github.com/rails/rails', ref: 'main'
gem 'selenium-webdriver'
gem 'props_template'
gem 'standard'
gem 'capybara'
gem 'minitest'
gem 'rake'
gem 'sqlite3'
7 changes: 0 additions & 7 deletions superglue_rails/superglue.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,4 @@ Gem::Specification.new do |s|
s.add_dependency "actionpack", ">= 7.0.0"
s.add_dependency "props_template", ">= 0.32.0"
s.add_dependency "form_props", ">= 0.0.5"

s.add_development_dependency "activerecord", ">= 7.0"
s.add_development_dependency "rake", " ~> 12.0"
s.add_development_dependency "sqlite3", "~> 1.3"
s.add_development_dependency "minitest", "~> 5.10"
s.add_development_dependency "capybara", "~> 3.0"
s.add_development_dependency "selenium-webdriver", "~> 3.11"
end
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,6 @@ def add_esbuild_cmd
successfully %(npm pkg set scripts.build="#{build_script}")
end

# def generate_test_app_6(app_name)
# successfully "rails new #{app_name} \
# --webpack \
# --skip-git \
# --skip-turbolinks \
# --skip-hotwire \
# --skip-spring \
# --no-rc"
# end

def generate_test_app_7(app_name)
successfully "rails new #{app_name} \
--javascript=esbuild \
Expand Down Expand Up @@ -164,7 +154,9 @@ def test_installation
click_button "Delete"
assert page.has_content?("Post was successfully destroyed.")
ensure
Process.kill "TERM", pid
Process.wait pid
if pid
Process.kill "TERM", pid
Process.wait pid
end
end
end

0 comments on commit a8a901e

Please sign in to comment.