@@ -42,14 +42,14 @@ jobs:
4242 runs-on : ubuntu-latest
4343
4444 steps :
45- - name : Checkout repo
46- uses : actions/checkout@v3
47- - name : Install Node
48- uses : actions/setup-node@v1
49- with :
50- node-version : 22
51- - run : npm install
52- - run : tsc
45+ - name : Checkout repo
46+ uses : actions/checkout@v3
47+ - name : Install Node
48+ uses : actions/setup-node@v1
49+ with :
50+ node-version : 22
51+ - run : npm install
52+ - run : tsc
5353
5454 tests :
5555 name : Ruby on Rails tests
@@ -58,22 +58,62 @@ jobs:
5858 strategy :
5959 matrix :
6060 ruby_version : [3.1, 3.2]
61- test_type : [test, test:system]
6261
6362 services :
64- mysql :
63+ mysql : &db-service
6564 image : mysql:8.0
6665 env :
6766 MYSQL_ROOT_HOST : ' %'
6867 MYSQL_ROOT_PASSWORD : ' root'
6968 MYSQL_DATABASE : ' qpixel_test'
7069 ports :
7170 - 3306:3306
72- redis :
71+ redis : &redis-service
7372 image : redis:8.0
7473 ports :
7574 - 6379:6379
7675
76+ steps :
77+ - name : Checkout repo
78+ uses : actions/checkout@v3
79+ - name : Setup dependencies
80+ run : |
81+ sudo apt-get -qq update
82+ sudo apt-get -yqq install libmariadb-dev libmagickwand-dev
83+ - name : Setup Ruby
84+ uses : ruby/setup-ruby@v1
85+ with :
86+ ruby-version : ${{ matrix.ruby_version }}
87+ bundler-cache : true
88+ - name : Prepare for testing
89+ run : |
90+ cp config/database.sample.yml config/database.yml
91+ cp config/storage.sample.yml config/storage.yml
92+ bundle exec rails db:create
93+ bundle exec rails db:schema:load
94+ bundle exec rails db:migrate
95+ bundle exec rails test:prepare
96+ - run : bundle exec rails test
97+ - uses : codecov/codecov-action@v5
98+ if : ${{ matrix.ruby_version == env.RUBY_VERSION && github.actor != 'dependabot[bot]' }}
99+ with :
100+ directory : coverage
101+ fail_ci_if_error : true
102+ report_type : coverage
103+ token : ${{ secrets.CODECOV_TOKEN }}
104+
105+ system-tests :
106+ name : Ruby on Rails system tests
107+ runs-on : ubuntu-latest
108+
109+ strategy :
110+ matrix :
111+ ruby_version : [3.1, 3.2]
112+
113+ services :
114+ mysql : *db-service
115+ redis : *redis-service
116+
77117 steps :
78118 - name : Checkout repo
79119 uses : actions/checkout@v3
@@ -82,10 +122,8 @@ jobs:
82122 sudo apt-get -qq update
83123 sudo apt-get -yqq install libmariadb-dev libmagickwand-dev
84124 - name : Setup Firefox
85- if : ${{ matrix.test_type == 'test:system' }}
86125 uses : browser-actions/setup-firefox@v1.5.4
87126 - name : Check Firefox setup
88- if : ${{ matrix.test_type == 'test:system' }}
89127 run : firefox --version
90128 - name : Setup Ruby
91129 uses : ruby/setup-ruby@v1
@@ -100,21 +138,13 @@ jobs:
100138 bundle exec rails db:schema:load
101139 bundle exec rails db:migrate
102140 bundle exec rails test:prepare
103- - run : bundle exec rails ${{ matrix.test_type }}
141+ - run : bundle exec rails test:system
104142 - name : Upload screenshots
105- if : ${{ matrix.test_type == 'test:system' }}
106143 uses : actions/upload-artifact@v4
107144 with :
108145 name : screenshots-${{ matrix.ruby_version }}
109146 path : tmp/screenshots
110147 if-no-files-found : ignore
111- - uses : codecov/codecov-action@v5
112- if : ${{ matrix.ruby_version == env.RUBY_VERSION && matrix.test_type == 'test' && github.actor != 'dependabot[bot]' }}
113- with :
114- directory : coverage
115- fail_ci_if_error : true
116- report_type : coverage
117- token : ${{ secrets.CODECOV_TOKEN }}
118148
119149 deploy :
120150 name : Dev server deployment
0 commit comments