Skip to content

Commit a319fdf

Browse files
committed
Upgrade CircleCI config to version 2.1
Also add support for running build against multiple versions of Ruby, starting with Ruby 3.0 and 3.1 Adds CircleCI orbs to support Ruby gem, NPM package, and browser installation
1 parent b2156c8 commit a319fdf

File tree

1 file changed

+53
-11
lines changed

1 file changed

+53
-11
lines changed

.circleci/config.yml

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,49 @@
1-
version: 2
2-
jobs:
3-
build:
4-
working_directory: ~/webpacker-react
1+
version: 2.1
2+
3+
orbs:
4+
ruby: circleci/[email protected]
5+
node: circleci/[email protected]
6+
browser-tools: circleci/[email protected]
7+
8+
executors:
9+
ruby-node-executor:
10+
parameters:
11+
ruby-version:
12+
type: string
13+
default: '3.0'
14+
working_directory: ~/react-rails-components
515
docker:
6-
- image: circleci/ruby:2.4.3-node-browsers
7-
environment:
8-
RAILS_ENV: test
16+
- image: cimg/ruby:<< parameters.ruby-version >>-node
17+
environment:
18+
RAILS_ENV: test
19+
20+
jobs:
21+
run-build:
22+
parameters:
23+
ruby-version:
24+
type: string
25+
default: '3.0'
26+
parallelism: 1
27+
executor:
28+
name: ruby-node-executor
29+
ruby-version: << parameters.ruby-version >>
30+
931
steps:
1032
- checkout
1133

12-
# Install dependencies
13-
- run:
14-
name: bundle install
15-
command: bundle install --path=vendor/bundle --jobs=4 --retry=3
34+
# Docs: https://circleci.com/developer/orbs/orb/circleci/browser-tools#commands-install-chromedriver
35+
- browser-tools/install-chrome
36+
- browser-tools/install-chromedriver
37+
38+
# Docs: https://circleci.com/developer/orbs/orb/circleci/ruby#commands-install-deps
39+
- ruby/install-deps
40+
41+
# Docs: https://circleci.com/developer/orbs/orb/circleci/node#commands-install-packages
42+
- node/install-packages:
43+
pkg-manager: yarn
44+
app-dir: javascript/webpacker_react-npm-module
45+
include-branch-in-cache-key: false
46+
1647
- run:
1748
command: yarn
1849
pwd: javascript/webpacker_react-npm-module
@@ -30,3 +61,14 @@ jobs:
3061
# Tests
3162
- run:
3263
command: bundle exec rake test
64+
65+
workflows:
66+
version: 2
67+
build:
68+
jobs:
69+
- run-build:
70+
matrix:
71+
parameters:
72+
ruby-version:
73+
- '3.0'
74+
- '3.1'

0 commit comments

Comments
 (0)