Skip to content

Commit 62f91ab

Browse files
committed
Create test.yml
1 parent 7feaf74 commit 62f91ab

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/test.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# This workflow uses actions that are not certified by GitHub. They are
2+
# provided by a third-party and are governed by separate terms of service,
3+
# privacy policy, and support documentation.
4+
#
5+
# This workflow will install a prebuilt Ruby version, install dependencies, and
6+
# run tests and linters.
7+
name: "Ruby on Rails CI"
8+
on:
9+
push:
10+
branches: [ "master" ]
11+
pull_request:
12+
branches: [ "master" ]
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
services:
19+
postgres:
20+
image: postgres:11-alpine
21+
ports:
22+
- "5432:5432"
23+
env:
24+
POSTGRES_DB: rails_test
25+
POSTGRES_USER: rails
26+
POSTGRES_PASSWORD: password
27+
env:
28+
RAILS_ENV: test
29+
NODE_ENV: test
30+
DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test"
31+
DRIVER: selenium_chrome
32+
CHROME_BIN: /usr/bin/google-chrome
33+
USE_COVERALLS: true
34+
steps:
35+
- name: Install Chrome
36+
uses: browser-actions/setup-chrome@latest
37+
- name: Check Chrome version
38+
run: chrome --version
39+
- name: Check Chrome version
40+
run: google-chrome --version
41+
- name: Set Display environment variable
42+
run: "export DISPLAY=:99"
43+
- name: Checkout code
44+
uses: actions/checkout@v3
45+
# Add or replace dependency steps here
46+
- name: Install Ruby and gems
47+
uses: ruby/setup-ruby@0a29871fe2b0200a17a4497bae54fe5df0d973aa # v1.115.3
48+
with:
49+
ruby: 3.x
50+
bundler-cache: true
51+
# Add or replace database setup steps here
52+
- name: Set up database schema
53+
run: bin/rails db:schema:load
54+
- name: Use Node.js 16.x
55+
uses: actions/setup-node@v3
56+
with:
57+
node-version: 16.x
58+
- name: Build
59+
run: |
60+
npm install
61+
npx webpack
62+
# Add or replace test runners here
63+
- name: Run tests with xvfb
64+
uses: GabrielBB/xvfb-action@v1
65+
with:
66+
run: bundle exec rake react_on_rails:locale
67+
working-directory: ./ #optional
68+
options: ":99 -ac -screen scn 1600x1200x16"

0 commit comments

Comments
 (0)