FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
roadmap/.github/workflows/postgres.yml at api-patch · DMPRoadmap/roadmap · GitHub
DMPRoadmap
roadmap
Repository navigation
Code
Issues
300
(300)
Pull requests
49
(49)
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
roadmap
/
.github
/
workflows
/
postgres.yml
Copy path
View runs
More file actions
More file actions
Latest commit
History
History
History
115 lines (96 loc) · 3.93 KB
Breadcrumbs
roadmap
/
.github
/
workflows
/
postgres.yml
Copy path
File metadata and controls
115 lines (96 loc) · 3.93 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name
:
Tests - PostgreSQL
on
:
[push, pull_request]
jobs
:
postgresql
:
runs-on
:
ubuntu-24.04
services
:
#
Postgres installation
db
:
image
:
postgres
env
:
#
Latest version of Postgres has increased security. We can use the default
#
user/password in this testing scenario though so use the following env
#
variable to bypass this changes:
#
https://github.com/docker-library/postgres/issues/681
POSTGRES_HOST_AUTH_METHOD
:
trust
ports
:
["5432:5432"]
options
:
>-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
#
Define environment variables for Postgres and Rails
env
:
RAILS_ENV
:
test
DATABASE_URL
:
postgres://postgres:@localhost:5432/roadmap_test
DISABLE_SPRING
:
1
steps
:
#
Checkout the repo
-
uses
:
actions/checkout@v3
#
Install Ruby and run bundler
-
uses
:
ruby/setup-ruby@v1
with
:
bundler-cache
:
true
#
# - run: echo 'NODE_OPTIONS="--openssl-legacy-provider"' >> $GITHUB_ENV
#
# /home/runner/runners/2.301.1/externals/node12/bin/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS
#
Install Node
-
uses
:
actions/setup-node@v3
with
:
node-version
:
18
cache
:
"
yarn
"
#
Install the Postgres developer packages
-
name
:
"
Install Postgresql Packages
"
run
:
|
sudo apt-get update
sudo apt-get install libpq-dev
#
Install ImageMagick (for `identify` command)
-
name
:
"
Install ImageMagick
"
run
:
|
sudo apt-get install -y imagemagick
#
Copy all of the example configs over
-
name
:
"
Setup Default Configuration
"
run
:
|
cp config/database.yml.sample config/database.yml
cp config/initializers/contact_us.rb.example config/initializers/contact_us.rb
cp config/initializers/wicked_pdf.rb.example config/initializers/wicked_pdf.rb
cp .env.postgresql .env
#
Stub out the Rails credentials file so that we can start the Rails app
-
name
:
"
Setup Credentials
"
run
:
|
# generate a default credential file and key
EDITOR="sh -c 'echo \"$(cat config/credentials.yml.postgresql)\" > \$1' --" bundle exec rails credentials:edit
#
Set the path to the wkhtmltopdf executable
-
name
:
"
Determine wkhtmltopdf location
"
run
:
echo "WICKED_PDF_PATH=`bundle exec which wkhtmltopdf`" >> $GITHUB_ENV
#
Run yarn install for JS dependencies
-
name
:
"
Yarn Install
"
run
:
|
yarn install
#
TEMPORARY WORKAROUND FOR THE FOLLOWING ISSUE: https://github.com/DMPRoadmap/roadmap/issues/3485
#
Remove this once our tests are compatible with the new version of Chrome
#
Source: https://github.com/teamcapybara/capybara/issues/2800#issuecomment-2731100953
-
name
:
Remove image-bundled Chrome
run
:
sudo apt-get purge google-chrome-stable
-
name
:
Setup stable Chrome
uses
:
browser-actions/setup-chrome@v1
with
:
chrome-version
:
128
install-chromedriver
:
true
install-dependencies
:
true
#
Initialize the DB
-
name
:
"
Setup Test DB
"
run
:
|
bundle exec rails db:setup
bundle exec rails db:migrate
#
Prebuild the CSS, JS and image assets
-
name
:
"
Compile Assets
"
run
:
bundle exec rails assets:precompile
#
Run the unit and functional tests
-
name
:
"
Run Rspec Unit and Functional Tests
"
run
:
|
bundle exec rspec spec/models/ spec/policies/ spec/services/ spec/helpers/
bundle exec rspec spec/controllers/ spec/presenters/ spec/requests/ spec/views
bundle exec rspec spec/mixins/
#
Run the time consuming integration tests (using Chrome headless browser)
-
name
:
"
Run Integration Tests
"
run
:
bundle exec rspec spec/features/
Back
|
FazBrowse Home
|
New Git URL