Skip to content
Open
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
56 changes: 56 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
version: 2.1
orbs:
# To install the required node version
node: circleci/node@5.0.3
jobs:
build:
# No. of servers/machines
parallelism: 1
docker:
- image: cimg/ruby:3.3.5
- image: cimg/redis:5.0.14
- image: cimg/postgres:9.6
environment:
POSTGRES_HOST_AUTH_METHOD: trust

#application directory change it with your application directory name
working_directory: ~/granite
environment:
TZ: "/usr/share/zoneinfo/America/New_York"
RAILS_ENV: "test"
RACK_ENV: "test"

steps:
- checkout
- node/install:
install-yarn: true
node-version: "22.13"
- run: node --version
- run: gem install bundler:2.2.20
#install sqlite dependency
- run: sudo apt update && sudo apt install zlib1g-dev libsqlite3-dev
# Bundle install
- run: bundle check --path=vendor/bundle || bundle install
--path=vendor/bundle --jobs=4 --retry=3
# Yarn install
- run: yarn install --cache-folder vendor/node_modules
# Ensure Rubocop has linted all Ruby files
- run: bundle exec rubocop
# Ensure Prettier+ESLint has been run on all JS files
- run:
npx prettier "./app/javascript/src/**/*.{js,jsx,json}" && npx eslint
"./app/javascript/src/**/*.{js,jsx,json}"
# Setup database
- run: cp config/database.yml.ci config/database.yml
- run: bundle exec rails db:create db:schema:load --trace
# Generate assets
- run: yarn build
# Unit tests
- run:
shell: /bin/bash
command: bundle exec rake db:test:prepare && bundle exec rails t -v
workflows:
version: 2
commit:
jobs:
- build
Loading