@@ -3,12 +3,13 @@ on: [push, pull_request]
33
44env :
55 RAILS_ENV : test
6- PAGEFLOW_DB_HOST : 127.0.0.1
6+ PAGEFLOW_DB_HOST : mysql
77
88jobs :
99 rspec :
1010 name : ${{ matrix.job }} (Rails ${{ matrix.rails-version }})
1111 runs-on : ubuntu-latest
12+ container : ghcr.io/${{ github.repository }}/test:latest
1213 env :
1314 PAGEFLOW_RAILS_VERSION : ${{ matrix.rails-version }}
1415
@@ -25,34 +26,29 @@ jobs:
2526 include :
2627 - job : pageflow
2728 engine-name : pageflow
28- ruby-version : 3.4
2929 engine-directory : .
3030 rspec-command : bin/rspec --tag ~js
3131 install-audiowaveform : true
3232
3333 - job : pageflow_js
3434 engine-name : pageflow
35- ruby-version : 3.4
3635 engine-directory : .
3736 rspec-command : bin/rspec-with-retry --tag js
3837
3938 - job : pageflow_paged
4039 engine-name : pageflow_paged
41- ruby-version : 3.4
4240 engine-directory : entry_types/paged
4341 plugin-name : pageflow_paged
4442 rspec-command : bin/rspec
4543
4644 - job : pageflow_scrolled
4745 engine-name : pageflow_scrolled
48- ruby-version : 3.4
4946 engine-directory : entry_types/scrolled
5047 plugin-name : pageflow_scrolled
5148 rspec-command : bin/rspec --tag ~js
5249
5350 - job : pageflow_scrolled_js
5451 engine-name : pageflow_scrolled
55- ruby-version : 3.4
5652 engine-directory : entry_types/scrolled
5753 plugin-name : pageflow_scrolled
5854 rspec-command : bin/rspec-with-retry-on-timeout --tag js
6460 MYSQL_ALLOW_EMPTY_PASSWORD : yes
6561 ports :
6662 - 3306:3306
67- # Set health checks to wait until mysql has started
6863 options : >-
6964 --health-cmd="mysqladmin ping"
7065 --health-interval=10s
@@ -73,77 +68,43 @@ jobs:
7368
7469 redis :
7570 image : redis
76- # Set health checks to wait until redis has started
7771 options : >-
7872 --health-cmd "redis-cli ping"
7973 --health-interval 10s
8074 --health-timeout 5s
8175 --health-retries 5
8276
8377 steps :
84- - uses : actions/checkout@v2
78+ - uses : actions/checkout@v4
8579
8680 # Caching
8781
8882 - name : Set up cache for Bundler
8983 uses : actions/cache@v4
9084 with :
9185 path : vendor/bundle
92- key : ${{ runner.os }}-ruby-${{ matrix.ruby-version }}- rails-${{ matrix.rails-version }}-gems -${{ hashFiles('**/*.gemspec') }}-${{ hashFiles('**/Gemfile') }}
86+ key : ${{ runner.os }}-gems- rails-${{ matrix.rails-version }}-${{ hashFiles('**/*.gemspec') }}-${{ hashFiles('**/Gemfile') }}
9387 restore-keys : |
94- ${{ runner.os }}-ruby-${{ matrix.ruby-version }}-rails-${{ matrix.rails-version }}-gems-
95-
96- - name : Get yarn cache directory path
97- id : yarn-cache-dir-path
98- run : echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
88+ ${{ runner.os }}-gems-rails-${{ matrix.rails-version }}-
9989
10090 - name : Set up cache for Yarn
10191 uses : actions/cache@v4
10292 with :
103- path : ${{ steps .yarn-cache-dir-path.outputs.dir }}
93+ path : .yarn-cache
10494 key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
10595 restore-keys : |
10696 ${{ runner.os }}-yarn-
10797
108- # Ruby/Node
109-
110- - name : Set up Ruby ${{ matrix.ruby-version }}
111- uses : ruby/setup-ruby@v1
112- with :
113- ruby-version : ${{ matrix.ruby-version }}
114-
115- - name : Use Node.js 22
116- uses : actions/setup-node@v1
117- with :
118- node-version : 22
119-
12098 # Dependencies
12199
122- - name : Install imagemagick package for image processing
123- run : |
124- sudo apt-get update
125- sudo apt-get install imagemagick
126-
127- - name : Install libvips package for image processing
128- run : |
129- sudo apt-get update
130- sudo apt-get install libvips-dev
131-
132- - name : Install audiowaveform package
133- if : ${{ matrix.install-audiowaveform == true}}
134- run : |
135- sudo add-apt-repository -y ppa:chris-needham/ppa
136- sudo apt-get update
137- sudo apt-get install audiowaveform
138-
139100 - name : Bundle install
140101 run : |
141102 bundle config path vendor/bundle
142103 bundle install --jobs 4 --retry 3
143104
144105 - name : Yarn install
145106 run : |
146- yarn install
107+ yarn install --cache-folder .yarn-cache
147108
148109 # Build
149110
@@ -171,6 +132,7 @@ jobs:
171132
172133 jest :
173134 runs-on : ubuntu-latest
135+ container : ghcr.io/${{ github.repository }}/test:latest
174136
175137 strategy :
176138 fail-fast : false
@@ -186,29 +148,20 @@ jobs:
186148 package-directory : entry_types/scrolled/package
187149
188150 steps :
189- - uses : actions/checkout@v2
190-
191- - name : Get yarn cache directory path
192- id : yarn-cache-dir-path
193- run : echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
151+ - uses : actions/checkout@v4
194152
195153 - name : Set up cache for Yarn
196154 uses : actions/cache@v4
197155 with :
198- path : ${{ steps .yarn-cache-dir-path.outputs.dir }}
156+ path : .yarn-cache
199157 key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
200158 restore-keys : |
201159 ${{ runner.os }}-yarn-
202160
203- - name : Set up Node.js 22
204- uses : actions/setup-node@v1
205- with :
206- node-version : 22
207-
208161 - name : Yarn install
209162 run : |
210- yarn install
211- (cd entry_types/paged/packages/pageflow-paged-react; yarn install)
163+ yarn install --cache-folder .yarn-cache
164+ (cd entry_types/paged/packages/pageflow-paged-react; yarn install --cache-folder ../../../../.yarn-cache )
212165
213166 - name : Build packages
214167 run : |
0 commit comments