-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (61 loc) · 1.67 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Ruby
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
services:
postgres:
image: postgres:10
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Show available Ruby versions, debug info
run: |
ls $RUNNER_TOOL_CACHE/Ruby
uname -a
cat /etc/os-release
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install dependencies
run: |
which yarn
which npm
yarn install --check-files
- name: Run tests
run: |
bundle exec rails db:create
bundle exec rails db:schema:load
bundle exec rake
bundle exec rails test:system
env:
SYSTEM_TEST: headless_firefox
#SYSTEM_TEST: headless_chrome
RAILS_ENV: test
TEST_DB_HOST: localhost
TEST_DB_NAME: postgres
TEST_DB_PASSWORD: postgres
TEST_DB_USERNAME: postgres
PG_PORT: ${{ job.services.postgres.ports['5432'] }}
- name: Deploy to staging Heroku
env:
HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }}
HEROKU_APP_NAME: 'staging-makeworks'
if: github.ref == 'refs/heads/master' && job.status == 'success'
run: git push https://heroku:[email protected]/$HEROKU_APP_NAME.git origin/master:master --force