Skip to content

Commit 9541041

Browse files
o-200aaronskiba
authored andcommitted
set 'Tests - PostgreSQL' on push, format
1 parent 9dad8a0 commit 9541041

File tree

1 file changed

+86
-86
lines changed

1 file changed

+86
-86
lines changed

.github/workflows/postgres.yml

Lines changed: 86 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Tests - PostgreSQL
22

3-
on: [pull_request]
3+
on: [push, pull_request]
44

55
jobs:
66
postgresql:
@@ -16,7 +16,7 @@ jobs:
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,87 @@ 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+
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/

0 commit comments

Comments
 (0)