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,86 +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- 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/
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