Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 19 additions & 47 deletions .github/workflows/js_test.yml
Original file line number Diff line number Diff line change
@@ -1,76 +1,48 @@
# 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 js tests.
name: "JS CI"

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
services:
postgres:
image: postgres:11-alpine
ports:
- "5432:5432"
env:
POSTGRES_DB: rails_test
POSTGRES_USER: rails
POSTGRES_PASSWORD: password
matrix:
node: [18.x]
ruby: [3.1.2]

env:
RAILS_ENV: test
NODE_ENV: test
DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test"
DRIVER: selenium_chrome
CHROME_BIN: /usr/bin/google-chrome
USE_COVERALLS: true
steps:
- name: Install Chrome
uses: browser-actions/setup-chrome@latest

- name: Check Chrome version
run: chrome --version

- name: Check Chrome version
run: google-chrome --version

- name: Set Display environment variable
run: "export DISPLAY=:99"

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Ruby and gems
uses: ruby/setup-ruby@0a29871fe2b0200a17a4497bae54fe5df0d973aa # v1.115.3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Use Node.js 18.x
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install Node Packages
run: npm install --legacy-peer-deps
node-version: ${{ matrix.node }}
cache: yarn

- name: Set up database schema
run: bin/rails db:schema:load
- name: Install dependencies
run: |
bundle install
yarn install --frozen-lockfile --non-interactive --prefer-offline

- name: Build i18n libraries
run: bundle exec rake react_on_rails:locale

- name: Build shakapacker chunks
run: NODE_ENV=development bundle exec bin/shakapacker

- name: Run js tests with xvfb
uses: GabrielBB/xvfb-action@v1
with:
run: bundle exec rake ci:js
working-directory: ./ #optional
options: ":99 -ac -screen scn 1600x1200x16"
- name: Run js tests
run: bundle exec rake ci:js
44 changes: 20 additions & 24 deletions .github/workflows/lint_test.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,47 @@
# 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 rspec tests.
name: "Lint CI"

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node: [18.x]
ruby: [3.1.2]

env:
RAILS_ENV: test
NODE_ENV: test
steps:
- name: Set Display environment variable
run: "export DISPLAY=:99"

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Ruby and gems
uses: ruby/setup-ruby@0a29871fe2b0200a17a4497bae54fe5df0d973aa # v1.115.3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Use Node.js 18.x
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install Node Packages
run: npm install --legacy-peer-deps
node-version: ${{ matrix.node }}
cache: yarn

- name: Install dependencies
run: |
bundle install
yarn install --frozen-lockfile --non-interactive --prefer-offline

- name: Build i18n libraries
run: bundle exec rake react_on_rails:locale

- name: Build shakapacker chunks
run: NODE_ENV=development bundle exec bin/shakapacker

- name: Run lint tests with xvfb
uses: GabrielBB/xvfb-action@v1
with:
run: bundle exec rake lint
working-directory: ./ #optional
options: ":99 -ac -screen scn 1600x1200x16"
- name: Run lint
run: bundle exec rake lint
36 changes: 22 additions & 14 deletions .github/workflows/rspec_test.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# 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"
name: "Rspec CI"

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node: [18.x]
ruby: [3.1.2]

services:
postgres:
image: postgres:11-alpine
Expand All @@ -24,13 +25,15 @@ jobs:
POSTGRES_DB: rails_test
POSTGRES_USER: rails
POSTGRES_PASSWORD: password

env:
RAILS_ENV: test
NODE_ENV: test
DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test"
DRIVER: selenium_chrome
CHROME_BIN: /usr/bin/google-chrome
USE_COVERALLS: true

steps:
- name: Install Chrome
uses: browser-actions/setup-chrome@latest
Expand All @@ -47,17 +50,22 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Ruby and gems
- name: Use Ruby ${{ matrix.node }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Use Node.js 18.x
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install Node Packages
run: npm install --legacy-peer-deps
node-version: ${{ matrix.node }}
cache: yarn

- name: Install dependencies
run: |
bundle install
yarn install --frozen-lockfile --non-interactive --prefer-offline

- name: Set up database schema
run: bin/rails db:schema:load
Expand All @@ -68,8 +76,8 @@ jobs:
- name: Build shakapacker chunks
run: NODE_ENV=development bundle exec bin/shakapacker

- name: Run tests with xvfb
uses: GabrielBB/xvfb-action@v1
- name: Run rspec with xvfb
uses: coactions/setup-xvfb@v1
with:
run: bundle exec rake ci:rspec
working-directory: ./ #optional
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"lint": " yarn lint:eslint --fix && yarn lint:prettier --w",
"test": "yarn build:test && yarn lint",
"test:client": "cd client && yarn test",
"build:test": "rm -rf public/webpack/test && RAILS_ENV=test NODE_ENV=test bin/shakapacker",
"build:dev": "rm -rf public/webpack/development && RAILS_ENV=development NODE_ENV=development bin/shakapacker",
"build:clean": "rm -rf public/webpack || true"
"build:test": "rm -rf public/packs-test && RAILS_ENV=test NODE_ENV=test bin/shakapacker",
"build:dev": "rm -rf public/packs && RAILS_ENV=development NODE_ENV=development bin/shakapacker",
"build:clean": "rm -rf public/packs || true"
},
"dependencies": {
"@babel/cli": "^7.21.0",
Expand Down