-
Notifications
You must be signed in to change notification settings - Fork 7
55 lines (51 loc) · 1.39 KB
/
ruby.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
# .github/workflows/ci.yml
name: CI
on:
push:
branches_ignore:
- "l10n_master2"
jobs:
test:
runs-on: ubuntu-latest
services:
db:
image: postgres:11
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
ports: ["6379:6379"]
options: --entrypoint redis-server
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test
REDIS_URL: redis://localhost:6379/0
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
steps:
- uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.2 # no need with ruby-version file
bundler-cache: true
- uses: actions/setup-node@v3
with:
node-version: 16
cache: "yarn"
- name: Build and precompile
run: |
sudo apt-get -yqq install libpq-dev curl libgconf-2-4
gem install bundler
bundle install --jobs 4 --retry 3
bundle exec rails db:prepare
bundle exec rake assets:precompile
- name: Build and run tests
run: |
bundle exec rspec ./spec