-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (69 loc) · 1.65 KB
/
test.yml
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
name: Run tests
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- '*'
tags:
- '*'
pull_request:
branches:
- '*'
tags:
- '*'
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:10
env:
MYSQL_ALLOW_EMPTY_PASSWORD: 1
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
redis:
image: redis:alpine
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.1
bundler-cache: true
- name: Use Node.js 16.x
uses: actions/[email protected]
with:
node-version: 16.x
cache: npm
- name: Install JavaScript dependencies
run: |
npm install -g yarn
yarn --frozen-lockfile
- name: Setup database
run: |
cp config/database.yml.mysql config/database.yml
mysql -u root -h 127.0.0.1 -e 'create database imgshr_test;'
- name: Test database mirations
env:
RAILS_ENV: test
TZ: Europe/Berlin
run: |
bundle exec rails db:migrate
- name: Test webpack bundling
run: |
bundle exec ./bin/webpack
- name: Run Rails tests
env:
RAILS_ENV: test
TZ: Europe/Berlin
run: |
bundle exec rails test
- name: Lint JavaScript code
run: |
yarn lint