Skip to content

Commit 41ff5ca

Browse files
authored
Fix capistrano configuration and CI (#165)
* Fix capistrano configuration * Fix CI * Bump ubuntu version in CI * Fix specs * Remove duplicated -y
1 parent f38fd3d commit 41ff5ca

10 files changed

Lines changed: 31 additions & 24 deletions

File tree

.github/workflows/decidim_ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ name: "[CI] Decidim"
22
on: [push]
33

44
env:
5-
RUBY_VERSION: 3.3.4
6-
NODE_VERSION: 18.17.1
5+
RUBY_VERSION: 3.4.7
6+
NODE_VERSION: 22.14.0
77

88
jobs:
99
tests:
1010
name: Tests
11-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-24.04
1212
services:
1313
postgres:
1414
image: postgres:13
@@ -31,6 +31,8 @@ jobs:
3131
- uses: actions/checkout@v2.0.0
3232
with:
3333
fetch-depth: 1
34+
- name: Install required libraries
35+
run: sudo apt-get update && sudo apt-get install -y libicu-dev imagemagick libvips libvips-tools
3436
- uses: ruby/setup-ruby@v1
3537
with:
3638
ruby-version: ${{ env.RUBY_VERSION }}

Capfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ install_plugin Capistrano::SCM::Git
3131
# require "capistrano/rvm"
3232
require "capistrano/rbenv"
3333
# require "capistrano/chruby"
34+
require "capistrano/nvm"
3435
require "capistrano/bundler"
3536
require "capistrano/puma"
3637
require "capistrano/rails/assets"

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ group :development do
4242
gem "capistrano"
4343
gem "capistrano3-puma", "~> 6.0"
4444
gem "capistrano-bundler"
45+
gem "capistrano-nvm", require: false
4546
gem "capistrano-passenger"
4647
gem "capistrano-rails"
4748
gem "capistrano-rails-console"

Gemfile.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ GEM
140140
sshkit (>= 1.9.0)
141141
capistrano-bundler (2.2.0)
142142
capistrano (~> 3.1)
143+
capistrano-nvm (0.0.7)
144+
capistrano (~> 3.1)
143145
capistrano-passenger (0.2.1)
144146
capistrano (~> 3.0)
145147
capistrano-rails (1.7.0)
@@ -1107,6 +1109,7 @@ DEPENDENCIES
11071109
byebug
11081110
capistrano
11091111
capistrano-bundler
1112+
capistrano-nvm
11101113
capistrano-passenger
11111114
capistrano-rails
11121115
capistrano-rails-console
@@ -1179,6 +1182,7 @@ CHECKSUMS
11791182
byebug (13.0.0) sha256=d2263efe751941ca520fa29744b71972d39cbc41839496706f5d9b22e92ae05d
11801183
capistrano (3.20.1) sha256=b0d54ba5cf49bb194998bf6b427e889aa36ed05f545ecf7cc37acb9d529e9ae9
11811184
capistrano-bundler (2.2.0) sha256=47b4cf2ea17ea132bb0a5cabc5663443f5190a54f4da5b322d04e1558ff1468c
1185+
capistrano-nvm (0.0.7) sha256=08840032d33705052a7d101781302c2938b56f28ea4d640ab3cba34f1ee8210f
11821186
capistrano-passenger (0.2.1) sha256=07a1d25edd5c1d909c19d4fe45fe2ea5f11200569f6967f6bff1d605ade98e13
11831187
capistrano-rails (1.7.0) sha256=aca57455e8c5435785e0f938e16aa5b79c263694a755e1dca1c5d1743b40aae7
11841188
capistrano-rails-console (2.3.0) sha256=32fc936a8f142837d1da8a9067d224356db7c9beb1baa63a64be6527421332bc

config/deploy.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
# frozen_string_literal: true
22

33
# config valid for current version and patch releases of Capistrano
4-
lock "~> 3.19.2"
4+
lock "~> 3.20.1"
55

66
SSHKit.config.command_map[:sidekiq] = 'bundle exec sidekiq'
77
SSHKit.config.command_map[:sidekiqctl] = 'bundle exec sidekiqctl'
88

99
set :rbenv_type, :user
1010
set :rbenv_ruby, '3.4.7'
1111

12+
set :nvm_type, :user # or :system, depends on your nvm setup
13+
set :nvm_node, "v22.14.0"
14+
set :nvm_map_bins, %w(node npm rake)
15+
1216
set :application, "metadecidim"
1317
set :repo_url, "https://github.com/decidim/metadecidim.git"
1418

@@ -57,8 +61,7 @@
5761
task :decidim_webpacker_install do
5862
on roles(:all) do
5963
within release_path do
60-
execute :'. ~/.nvm/nvm.sh'
61-
execute 'npm', 'ci'
64+
execute :npm, 'ci'
6265
end
6366
end
6467
end

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"shakapacker": "^9.7.0"
2020
},
2121
"engines": {
22-
"node": "18.17.1",
23-
"npm": "9.6.7",
22+
"node": "22.14.0",
23+
"npm": ">=10.0.0",
2424
"yarn": "~1.22.1"
2525
}
2626
}

spec/features/authentication_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
describe 'Sign Up' do
1414
context 'when using email and password' do
1515
it 'ask confirmations on new Users' do
16-
find('a[href="/users/sign_up"').click
16+
visit decidim.new_user_registration_path
1717

1818
within '.new_user' do
1919
fill_in :registration_user_email, with: 'user@example.org'

spec/features/homepage_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
visit decidim.root_path
1414
# By default there isn't any Content Block enabled, so we search a content from the header
1515
within ".main-bar" do
16-
expect(page).to have_content('Help')
16+
expect(page).to have_content('Log in')
1717
end
1818
end
1919
end

spec/features/menu_spec.rb

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
let(:user) { create :user, :confirmed }
88

99
before do
10-
Decidim::ContentBlock.create!(
11-
organization:,
12-
scope_name: :homepage,
13-
scoped_resource_id: nil,
14-
manifest_name: :global_menu,
15-
published_at: Time.zone.now
16-
)
17-
1810
switch_to_host(organization.host)
1911
end
2012

@@ -36,7 +28,9 @@
3628
it "the main menu has the Metadecidim elements" do
3729
visit decidim.root_path
3830

39-
within "#home__menu" do
31+
find("#main-dropdown-summary-desktop").click
32+
33+
within "#breadcrumb-main-dropdown-desktop" do
4034
expect(page).to have_content("Start here")
4135
expect(page).to have_content("Participate")
4236
expect(page).to have_content("The Association")
@@ -65,7 +59,7 @@
6559
it "the breadcrumb menu has the Metadecidim elements" do
6660
visit decidim.pages_path
6761

68-
find("a.menu-bar__breadcrumb-desktop__dropdown-trigger").sibling("button[data-controller='dropdown']").hover
62+
find("#main-dropdown-summary-desktop").click
6963

7064
within "#breadcrumb-main-dropdown-desktop" do
7165
expect(page).to have_content("Home")
@@ -89,7 +83,9 @@
8983
end
9084

9185
specify "the menu is translated" do
92-
within "#home__menu" do
86+
find("#main-dropdown-summary-desktop").click
87+
88+
within "#breadcrumb-main-dropdown-desktop" do
9389
expect(page).to have_content("Comença aquí")
9490
expect(page).to have_content("Participa")
9591
expect(page).to have_content("L'Associació")
@@ -108,7 +104,7 @@
108104
end
109105

110106
specify "the menu is customized" do
111-
click_on "Main menu"
107+
find("#main-dropdown-summary-mobile").click
112108

113109
within "#breadcrumb-main-dropdown-mobile" do
114110
expect(page).to have_content("Home")

0 commit comments

Comments
 (0)