forked from Ruvail/NXTFolio
-
Notifications
You must be signed in to change notification settings - Fork 5
109 lines (109 loc) · 3.13 KB
/
rubyonrails.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# This workflow uses actions that are not certified by GitHub. They are
# provided by a third-party and are governed by separate terms of service,
# privacy policy, and support documentation.
#
# This workflow will install a prebuilt Ruby version, install dependencies, and
# run tests and linters.
name: "Ruby on Rails CI"
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
cucumber:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11-alpine
ports:
- "5432:5432"
env:
POSTGRES_DB: workspace_test
POSTGRES_USER: beaverthing
POSTGRES_PASSWORD: beaverthing
browser:
image: selenium/standalone-firefox:latest
ports:
- 4444:4444
env:
RAILS_ENV: test
SELENIUM_HOST: localhost
SELENIUM_PORT: 4444
#RAILS_HOST: # ip of hostHow
RAILS_PORT: 3000
steps:
- name: Install Package
uses: ConorMacBride/[email protected]
with:
apt: nodejs
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/[email protected]
with:
bundler: 'Gemfile.lock'
bundler-cache: true
ruby-version: 3.2.2
- name: Set up database schema
run:
bin/rails db:create
bin/rails db:schema:load
# - name: Compile assets
# run:
# rake assets:clobber
# rake assets:precompile
- name: Set RAILS_HOST
run: echo "RAILS_HOST=$(hostname -I | awk '{print $1}')" >> $GITHUB_ENV
- name: Run cucumber tests
run: bin/rake cucumber
spec:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11-alpine
ports:
- "5432:5432"
env:
POSTGRES_DB: workspace_test
POSTGRES_USER: beaverthing
POSTGRES_PASSWORD: beaverthing
browser:
image: selenium/standalone-firefox:latest
ports:
- 4444:4444
env:
RAILS_ENV: test
SELENIUM_HOST: localhost
SELENIUM_PORT: 4444
#RAILS_HOST: # ip of hostHow
RAILS_PORT: 3000
OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}}
steps:
- name: Install Package
uses: ConorMacBride/[email protected]
with:
apt: nodejs
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/[email protected]
with:
bundler: 'Gemfile.lock'
bundler-cache: true
ruby-version: 3.2.2
- name: Set up database schema
run:
bin/rails db:create
bin/rails db:schema:load
- name: Set RAILS_HOST
run: echo "RAILS_HOST=$(hostname -I | awk '{print $1}')" >> $GITHUB_ENV
- name: Run spec tests
run: bin/rake spec
- name: Report coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
with:
coverageLocations: ${{github.workspace}}/coverage/coverage.json:simplecov
debug: true