11name : Tests - PostgreSQL
22
3- on : [pull_request]
3+ on : [push, pull_request]
44
55jobs :
66 postgresql :
1616 # variable to bypass this changes:
1717 # https://github.com/docker-library/postgres/issues/681
1818 POSTGRES_HOST_AUTH_METHOD : trust
19- ports : [' 5432:5432' ]
19+ ports : [" 5432:5432" ]
2020 options : >-
2121 --health-cmd pg_isready
2222 --health-interval 10s
@@ -30,87 +30,86 @@ jobs:
3030 DISABLE_SPRING : 1
3131
3232 steps :
33- # Checkout the repo
34- - uses : actions/checkout@v3
35-
36- # Install Ruby and run bundler
37- - uses : ruby/setup-ruby@v1
38- with :
39- ruby-version : ' 3.0'
40- bundler-cache : true
41-
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-
45- # Install Node
46- - uses : actions/setup-node@v3
47- with :
48- node-version : 18
49- cache : ' yarn'
50-
51- # Install the Postgres developer packages
52- - name : ' Install Postgresql Packages'
53- run : |
54- sudo apt-get update
55- sudo apt-get install libpq-dev
56-
57- # Install ImageMagick (for `identify` command)
58- - name : ' Install ImageMagick'
59- run : |
60- sudo apt-get install -y imagemagick
61-
62- # Copy all of the example configs over
63- - name : ' Setup Default Configuration'
64- run : |
65- cp config/database.yml.sample config/database.yml
66- cp config/initializers/contact_us.rb.example config/initializers/contact_us.rb
67- cp config/initializers/wicked_pdf.rb.example config/initializers/wicked_pdf.rb
68- cp .env.postgresql .env
69-
70- # Stub out the Rails credentials file so that we can start the Rails app
71- - name : ' Setup Credentials'
72- run : |
73- # generate a default credential file and key
74- EDITOR="sh -c 'echo \"$(cat config/credentials.yml.postgresql)\" > \$1' --" bundle exec rails credentials:edit
75-
76- # Set the path to the wkhtmltopdf executable
77- - name : ' Determine wkhtmltopdf location'
78- run : echo "WICKED_PDF_PATH=`bundle exec which wkhtmltopdf`" >> $GITHUB_ENV
79-
80- # Run yarn install for JS dependencies
81- - name : ' Yarn Install'
82- run : |
83- yarn install
84-
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-
97- # Initialize the DB
98- - name : ' Setup Test DB'
99- run : |
100- bundle exec rails db:setup
101- bundle exec rails db:migrate
102-
103- # Prebuild the CSS, JS and image assets
104- - name : ' Compile Assets'
105- run : bundle exec rails assets:precompile
106-
107- # Run the unit and functional tests
108- - name : ' Run Rspec Unit and Functional Tests'
109- run : |
110- bundle exec rspec spec/models/ spec/policies/ spec/services/ spec/helpers/
111- bundle exec rspec spec/controllers/ spec/presenters/ spec/requests/ spec/views
112- bundle exec rspec spec/mixins/
113-
114- # Run the time consuming integration tests (using Chrome headless browser)
115- - name : ' Run Integration Tests'
116- run : bundle exec rspec spec/features/
33+ # Checkout the repo
34+ - uses : actions/checkout@v3
35+
36+ # Install Ruby and run bundler
37+ - uses : ruby/setup-ruby@v1
38+ with :
39+ bundler-cache : true
40+
41+ # # - run: echo 'NODE_OPTIONS="--openssl-legacy-provider"' >> $GITHUB_ENV
42+ # # /home/runner/runners/2.301.1/externals/node12/bin/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS
43+
44+ # Install Node
45+ - uses : actions/setup-node@v3
46+ with :
47+ node-version : 18
48+ cache : " yarn"
49+
50+ # Install the Postgres developer packages
51+ - name : " Install Postgresql Packages"
52+ run : |
53+ sudo apt-get update
54+ sudo apt-get install libpq-dev
55+
56+ # Install ImageMagick (for `identify` command)
57+ - name : " Install ImageMagick"
58+ run : |
59+ sudo apt-get install -y imagemagick
60+
61+ # Copy all of the example configs over
62+ - name : " Setup Default Configuration"
63+ run : |
64+ cp config/database.yml.sample config/database.yml
65+ cp config/initializers/contact_us.rb.example config/initializers/contact_us.rb
66+ cp config/initializers/wicked_pdf.rb.example config/initializers/wicked_pdf.rb
67+ cp .env.postgresql .env
68+
69+ # Stub out the Rails credentials file so that we can start the Rails app
70+ - name : " Setup Credentials"
71+ run : |
72+ # generate a default credential file and key
73+ EDITOR="sh -c 'echo \"$(cat config/credentials.yml.postgresql)\" > \$1' --" bundle exec rails credentials:edit
74+
75+ # Set the path to the wkhtmltopdf executable
76+ - name : " Determine wkhtmltopdf location"
77+ run : echo "WICKED_PDF_PATH=`bundle exec which wkhtmltopdf`" >> $GITHUB_ENV
78+
79+ # Run yarn install for JS dependencies
80+ - name : " Yarn Install"
81+ run : |
82+ yarn install
83+
84+ # TEMPORARY WORKAROUND FOR THE FOLLOWING ISSUE: https://github.com/DMPRoadmap/roadmap/issues/3485
85+ # Remove this once our tests are compatible with the new version of Chrome
86+ # Source: https://github.com/teamcapybara/capybara/issues/2800#issuecomment-2731100953
87+ - name : Remove image-bundled Chrome
88+ run : sudo apt-get purge google-chrome-stable
89+ - name : Setup stable Chrome
90+ uses : browser-actions/setup-chrome@v1
91+ with :
92+ chrome-version : 128
93+ install-chromedriver : true
94+ install-dependencies : true
95+
96+ # Initialize the DB
97+ - name : " Setup Test DB"
98+ run : |
99+ bundle exec rails db:setup
100+ bundle exec rails db:migrate
101+
102+ # Prebuild the CSS, JS and image assets
103+ - name : " Compile Assets"
104+ run : bundle exec rails assets:precompile
105+
106+ # Run the unit and functional tests
107+ - name : " Run Rspec Unit and Functional Tests"
108+ run : |
109+ bundle exec rspec spec/models/ spec/policies/ spec/services/ spec/helpers/
110+ bundle exec rspec spec/controllers/ spec/presenters/ spec/requests/ spec/views
111+ bundle exec rspec spec/mixins/
112+
113+ # Run the time consuming integration tests (using Chrome headless browser)
114+ - name : " Run Integration Tests"
115+ run : bundle exec rspec spec/features/
0 commit comments