@@ -4,7 +4,7 @@ on: [pull_request]
44
55jobs :
66 postgresql :
7- runs-on : ubuntu-latest
7+ runs-on : ubuntu-24.04
88
99 services :
1010 # Postgres installation
@@ -27,20 +27,25 @@ jobs:
2727 env :
2828 RAILS_ENV : test
2929 DATABASE_URL : postgres://postgres:@localhost:5432/roadmap_test
30+ DISABLE_SPRING : 1
3031
3132 steps :
3233 # Checkout the repo
33- - uses : actions/checkout@v2
34+ - uses : actions/checkout@v3
3435
3536 # Install Ruby and run bundler
3637 - uses : ruby/setup-ruby@v1
3738 with :
3839 ruby-version : 3.3.8
3940 bundler-cache : true
4041
42+ # # - run: echo 'NODE_OPTIONS="--openssl-legacy-provider"' >> $GITHUB_ENV
43+ # # /home/runner/runners/2.301.1/externals/node12/bin/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS
44+
4145 # Install Node
42- - uses : actions/setup-node@v2
46+ - uses : actions/setup-node@v3
4347 with :
48+ node-version : 18
4449 cache : ' yarn'
4550
4651 # Install the Postgres developer packages
@@ -49,18 +54,24 @@ jobs:
4954 sudo apt-get update
5055 sudo apt-get install libpq-dev
5156
57+ # Install ImageMagick (for `identify` command)
58+ - name : ' Install ImageMagick'
59+ run : |
60+ sudo apt-get install -y imagemagick
61+
5262 # Copy all of the example configs over
5363 - name : ' Setup Default Configuration'
5464 run : |
5565 cp config/database.yml.sample config/database.yml
5666 cp config/initializers/contact_us.rb.example config/initializers/contact_us.rb
5767 cp config/initializers/wicked_pdf.rb.example config/initializers/wicked_pdf.rb
68+ cp .env.postgresql .env
5869
5970 # Stub out the Rails credentials file so that we can start the Rails app
6071 - name : ' Setup Credentials'
6172 run : |
6273 # generate a default credential file and key
63- EDITOR='echo "$(cat config/credentials.yml.example) " >' bundle exec rails credentials:edit
74+ EDITOR="sh -c 'echo \ "$(cat config/credentials.yml.postgresql)\ " > \$1' --" bundle exec rails credentials:edit
6475
6576 # Set the path to the wkhtmltopdf executable
6677 - name : ' Determine wkhtmltopdf location'
@@ -71,11 +82,23 @@ jobs:
7182 run : |
7283 yarn install
7384
85+ # TEMPORARY WORKAROUND FOR THE FOLLOWING ISSUE: https://github.com/DMPRoadmap/roadmap/issues/3485
86+ # Remove this once our tests are compatible with the new version of Chrome
87+ # Source: https://github.com/teamcapybara/capybara/issues/2800#issuecomment-2731100953
88+ - name : Remove image-bundled Chrome
89+ run : sudo apt-get purge google-chrome-stable
90+ - name : Setup stable Chrome
91+ uses : browser-actions/setup-chrome@v1
92+ with :
93+ chrome-version : 128
94+ install-chromedriver : true
95+ install-dependencies : true
96+
7497 # Initialize the DB
7598 - name : ' Setup Test DB'
7699 run : |
77- bundle exec rails db:setup RAILS_ENV=test
78- bundle exec rails db:migrate RAILS_ENV=test
100+ bundle exec rails db:setup
101+ bundle exec rails db:migrate
79102
80103 # Prebuild the CSS, JS and image assets
81104 - name : ' Compile Assets'
0 commit comments