From 28e01243c010d7551aec7895ab5e52ed28f98830 Mon Sep 17 00:00:00 2001 From: Yusuke Nakamura Date: Sun, 17 Sep 2023 02:46:41 +0900 Subject: [PATCH 1/8] Remove upstream's original github actions definition --- .github/workflows/main.yml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index be8e3fd99..000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Deploy - -on: - push: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: akhileshns/heroku-deploy@v3.12.12 # This is the action - with: - heroku_api_key: ${{secrets.HEROKU_API_KEY}} - heroku_app_name: "cfp-next-staging" #Must be unique in Heroku - heroku_email: "adarsh@cylinder.work" From 81d8ad461070dce9f68bae45a430992b07cf5121 Mon Sep 17 00:00:00 2001 From: Yusuke Nakamura Date: Sun, 17 Sep 2023 02:47:16 +0900 Subject: [PATCH 2/8] Run rspec on github actions --- .github/workflows/test.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..5499b9705 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,37 @@ +name: test +on: + push: + branches: + - "*" + pull_request: + branches: + - "*" +jobs: + rspec: + name: rspec + runs-on: ubuntu-22.04 + services: + postgres: + image: postgres:14.9-bookworm # heroku postgres + ports: + - 5432:5432 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: cfp_app_test + env: + RAILS_ENV: test + DATABASE_URL: postgres://postgres:postgres@localhost:5432/cfp_app_test + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.1.2" + bundler-cache: true + - uses: actions/setup-node@v3 + with: + node-version-file: ".node-version" + cache: "yarn" + - run: yarn install --frozen-lockfile + - run: bundle exec rails db:setup + - run: bundle exec rspec From 6c3d0d917c63cf73dc6b9423ded6f7bb7ec2689b Mon Sep 17 00:00:00 2001 From: Yusuke Nakamura Date: Sun, 17 Sep 2023 02:59:29 +0900 Subject: [PATCH 3/8] Use selenium-webdriver latest https://github.com/titusfortner/webdrivers?tab=readme-ov-file#update-future-of-this-project --- Gemfile | 1 - Gemfile.lock | 11 +++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Gemfile b/Gemfile index 35d5f54a8..39d1c6a38 100644 --- a/Gemfile +++ b/Gemfile @@ -103,5 +103,4 @@ group :development, :test do gem 'selenium-webdriver' gem 'spring' gem 'timecop' - gem 'webdrivers', '~> 4.7' end diff --git a/Gemfile.lock b/Gemfile.lock index 67a21c07b..39865fcde 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -127,7 +127,7 @@ GEM autoprefixer-rails (>= 5.2.1) sassc (>= 2.0.0) builder (3.2.4) - capybara (3.38.0) + capybara (3.39.2) addressable matrix mini_mime (>= 0.1.3) @@ -422,7 +422,7 @@ GEM responders (3.1.0) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.2.5) + rexml (3.2.6) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) @@ -462,7 +462,7 @@ GEM sprockets-rails tilt selectize-rails (0.12.6) - selenium-webdriver (4.8.0) + selenium-webdriver (4.12.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) @@ -516,10 +516,6 @@ GEM activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - webdrivers (4.7.0) - nokogiri (~> 1.6) - rubyzip (>= 1.3.0) - selenium-webdriver (> 3.141, < 5.0) webpacker (5.4.4) activesupport (>= 5.2) rack-proxy (>= 0.6.1) @@ -617,7 +613,6 @@ DEPENDENCIES uglifier (>= 1.3.0) underscore-rails web-console - webdrivers (~> 4.7) webpacker RUBY VERSION From 6d2b49563274f4b9b9b3273e0b1d7308a008d77a Mon Sep 17 00:00:00 2001 From: Yusuke Nakamura Date: Sun, 17 Sep 2023 03:10:32 +0900 Subject: [PATCH 4/8] Use en locale on test env --- config/environments/test.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/environments/test.rb b/config/environments/test.rb index 4841b572e..8f56488e1 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -52,4 +52,5 @@ # Raises error for missing translations. # config.action_view.raise_on_missing_translations = true + config.i18n.default_locale = :en end From 692a248f9ce7cae91a70c33dff6bc886cd0b3bff Mon Sep 17 00:00:00 2001 From: Yusuke Nakamura Date: Sun, 17 Sep 2023 03:29:19 +0900 Subject: [PATCH 5/8] Fix specs --- spec/features/current_event_user_flow_spec.rb | 4 ++-- spec/features/receive_speaker_invitation_spec.rb | 1 + spec/features/staff/teammate_invitation_spec.rb | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/features/current_event_user_flow_spec.rb b/spec/features/current_event_user_flow_spec.rb index 9a79b0000..e3679fdaf 100644 --- a/spec/features/current_event_user_flow_spec.rb +++ b/spec/features/current_event_user_flow_spec.rb @@ -58,7 +58,7 @@ expect(current_path).to eq(events_path) within ".navbar" do - expect(page).to have_link("CFP App") + expect(page).to have_link("Kaigi on Rails CFPApp") # https://github.com/kaigionrails/cfp-app/commit/e745df4da883 expect(page).to_not have_link("My Proposals") expect(page).to have_link("", href: "/notifications") expect(page).to have_link(normal_user.name) @@ -113,7 +113,7 @@ signin(normal_user.email, normal_user.password) within ".navbar" do - expect(page).to have_content("CFP App") + expect(page).to have_content("Kaigi on Rails CFPApp") # https://github.com/kaigionrails/cfp-app/commit/e745df4da883 expect(page).to have_link("", href: "/notifications") expect(page).to have_link(normal_user.name) end diff --git a/spec/features/receive_speaker_invitation_spec.rb b/spec/features/receive_speaker_invitation_spec.rb index f71bcd114..5c6093a8f 100644 --- a/spec/features/receive_speaker_invitation_spec.rb +++ b/spec/features/receive_speaker_invitation_spec.rb @@ -94,6 +94,7 @@ end it "can use a twitter oauth account" do + skip # https://github.com/kaigionrails/cfp-app/pull/5 click_link "Sign up" click_link "Sign in with Twitter" expect(page).to have_content("You have accepted your invitation!") diff --git a/spec/features/staff/teammate_invitation_spec.rb b/spec/features/staff/teammate_invitation_spec.rb index 9c7125b18..358474332 100644 --- a/spec/features/staff/teammate_invitation_spec.rb +++ b/spec/features/staff/teammate_invitation_spec.rb @@ -64,6 +64,7 @@ end it "can use a twitter oauth account" do + skip # https://github.com/kaigionrails/cfp-app/pull/5 click_link "Sign up" click_link "Sign in with Twitter" expect(page).to have_content("Congrats! You are now an official team member of My Event!") From 757c70482020926bf292a973677c6885783ad0f0 Mon Sep 17 00:00:00 2001 From: Yusuke Nakamura Date: Sun, 17 Sep 2023 03:10:49 +0900 Subject: [PATCH 6/8] Fix locale --- config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index e8f93251d..1eecaebcc 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -37,7 +37,7 @@ en: closes: "CFP closes:" form: "Proposal Form" preview: "Preview" - instruction: Read the %{guidelines} to maximize your chance of approval. Refrain from including any information that would allow a reviewer to identify you. + instruction: Read the %{guideline} to maximize your chance of approval. Refrain from including any information that would allow a reviewer to identify you. guidelines: guidelines gfm_html: All fields support GitHub Flavored Markdown form: From 44fdb064364c5eb89c1727132425d573bacc1479 Mon Sep 17 00:00:00 2001 From: Yusuke Nakamura Date: Thu, 22 Feb 2024 01:11:41 +0900 Subject: [PATCH 7/8] Remove .ruby-version from setup-ruby automatically detected --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5499b9705..52bcd38f3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,6 @@ jobs: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.1.2" bundler-cache: true - uses: actions/setup-node@v3 with: From a4d0a9e928f3e57189986a0c1c5ff3c05c4886da Mon Sep 17 00:00:00 2001 From: Yusuke Nakamura Date: Thu, 22 Feb 2024 01:12:07 +0900 Subject: [PATCH 8/8] Update setup-node to v4 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 52bcd38f3..5811c11be 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: - uses: ruby/setup-ruby@v1 with: bundler-cache: true - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version-file: ".node-version" cache: "yarn"