-
-
Notifications
You must be signed in to change notification settings - Fork 71
65 lines (59 loc) · 1.59 KB
/
test.yml
File metadata and controls
65 lines (59 loc) · 1.59 KB
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
name: Rails testing
on:
push:
branches:
- develop
pull_request:
branches:
- develop
env:
RAILS_ENV: test
jobs:
tests:
name: Ruby on Rails tests
runs-on: ubuntu-latest
strategy:
matrix:
ruby_version: [3.1, 3.2]
test_type: [test, test:system]
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_HOST: '%'
MYSQL_ROOT_PASSWORD: 'root'
MYSQL_DATABASE: 'qpixel_test'
ports:
- 3306:3306
redis:
image: redis:8.0
ports:
- 6379:6379
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup dependencies
run: |
sudo apt-get -qq update
sudo apt-get -yqq install libmariadb-dev libmagickwand-dev firefox-esr
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- name: Prepare for testing
run: |
cp config/database.sample.yml config/database.yml
cp config/storage.sample.yml config/storage.yml
bundle exec rails db:create
bundle exec rails db:schema:load
bundle exec rails db:migrate
bundle exec rails test:prepare
- run: bundle exec rails ${{ matrix.test_type }}
- name: Upload screenshots
if: ${{ matrix.test_type == 'test:system' }}
uses: actions/upload-artifact@v4
with:
name: screenshots-${{ matrix.ruby_version }}
path: ~/tmp/screenshots
if-no-files-found: ignore