11version : 2.1
22
33orbs :
4- browser-tools : circleci/browser-tools@1.5.2
4+ browser-tools : circleci/browser-tools@2.2.0
55 node : circleci/node@7.1.0
66
77jobs :
@@ -10,12 +10,10 @@ jobs:
1010 docker :
1111 - image : cimg/ruby:4.0.1-browsers
1212 environment :
13- BUNDLE_JOBS : 3
14- BUNDLE_RETRY : 3
1513 BUNDLE_PATH : vendor/bundle
14+ NODE_VERSION : 22.17.1
1615 PGHOST : 127.0.0.1
1716 PGUSER : postgres
18- RACK_ENV : test
1917 RAILS_ENV : test
2018 - image : cimg/postgres:10.18
2119 environment :
@@ -25,22 +23,27 @@ jobs:
2523
2624 steps :
2725 - checkout
28- - browser-tools/install-browser-tools :
29- install-chrome : false
30- install-chromedriver : false
3126
3227 - node/install :
33- node-version : lts
28+ node-version : 25.6.0
29+
30+ - node/install-packages :
31+ pkg-manager : pnpm
32+
33+ - browser-tools/install_firefox
3434
3535 - run :
36- name : Which bundler?
37- command : bundle -v
36+ name : Which versions?
37+ command : |
38+ bundle -v
39+ node --version
40+ pnpm --version
3841
3942 # https://circleci.com/docs/2.0/caching/
4043 - restore_cache :
4144 keys :
42- - bundle-v1 -{{ checksum "Gemfile.lock" }}
43- - bundle-v1-
45+ - bundle-v2 -{{ checksum "Gemfile.lock" }}
46+ - bundle-v2
4447
4548 - run : # Install Ruby dependencies
4649 name : Bundle Install
@@ -50,41 +53,46 @@ jobs:
5053 bundle clean
5154
5255 - save_cache :
53- key : bundle-v1 -{{ checksum "Gemfile.lock" }}
56+ key : bundle-v2 -{{ checksum "Gemfile.lock" }}
5457 paths :
5558 - vendor/bundle
5659
57- - node/install-packages :
58- pkg-manager : pnpm
59-
60- - run :
61- name : Build JS assets
62- command : pnpm build
63-
6460 - run :
6561 name : Wait for DB
6662 command : dockerize -wait tcp://localhost:5432 -timeout 1m
6763
6864 - run :
6965 name : Database setup
70- command : bundle exec rake db:create db:schema:load --trace
66+ command : bin/rails db:setup --trace
7167
72- # - run:
73- # name: Brakeman
74- # command: bundle exec brakeman
68+ - run :
69+ name : Typescript
70+ command : pnpm tscheck
71+
72+ - run :
73+ name : Find Unused ESLint Rules
74+ command : pnpm eslint_find_unused_rules
7575
7676 - run :
7777 name : ESLint
7878 command : pnpm eslint
7979
8080 - run :
81- name : Stylelint
82- command : pnpm stylelint
81+ name : Verify ESLint Autogen
82+ command : bundle exec exe/eslint_autogen
8383
8484 - run :
8585 name : Vitest
8686 command : pnpm vitest run --coverage
8787
88+ - run :
89+ name : Brakeman
90+ command : bundle exec brakeman
91+
92+ - run :
93+ name : Stylelint
94+ command : pnpm stylelint
95+
8896 - run :
8997 name : Verify Stylelint Autogen
9098 command : bundle exec exe/stylelint_autogen
@@ -94,37 +102,37 @@ jobs:
94102 command : bundle exec rubocop
95103
96104 - run :
97- name : Run rspec in parallel
105+ name : ✨ 🌈 ✨ Run Unit Tests ✨ 🌈 ✨
98106 command : |
99- bundle exec rspec --exclude-pattern "spec/system/*_spec.rb"
100- # bundle exec rspec --profile 10 \
101- # --format RspecJunitFormatter \
102- # --out test_results/rspec.xml \
103- # --format progress \
104- # $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
105-
106- - store_test_results : # https://circleci.com/docs/2.0/collect-test-data/
107- path : test_results
107+ TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | \
108+ grep -v "spec/system" | \
109+ circleci tests split --split-by=timings)"
110+
111+ echo "******************** TEST_FILES ************************"
112+ echo "bundle exec rspec -s <seed-from-failed-build> $TEST_FILES"
113+ echo "********************************************************"
114+
115+ COVERAGE=true bundle exec rspec \
116+ --format progress \
117+ --format RspecJunitFormatter \
118+ --out /tmp/test-results/rspec.xml \
119+ $TEST_FILES
108120
109121 - run :
110- name : Run system tests
122+ name : ✨ 🌈 ✨ Run System Tests ✨ 🌈 ✨
111123 command : |
112- COVERAGE=false bundle exec rspec spec/system/
124+ TEST_FILES="$(circleci tests glob "spec/system/**/*_spec.rb" | \
125+ circleci tests split --split-by=timings)"
113126
114- workflows :
115- build :
116- jobs :
117- - build
118-
119- # https://circleci.com/docs/2.0/workflows/#nightly-example
120- # https://circleci.com/docs/2.0/configuration-reference/#filters-1
121- repeat :
122- jobs :
123- - build
124- triggers :
125- - schedule :
126- cron : " 0,20,40 * * * *"
127- filters :
128- branches :
129- only :
130- - /.*ci-repeat.*/
127+ echo "******************** TEST_FILES ************************"
128+ echo "bundle exec rspec -s <seed-from-failed-build> $TEST_FILES"
129+ echo "********************************************************"
130+
131+ xvfb-run -a bundle exec rspec \
132+ --format progress \
133+ --format RspecJunitFormatter \
134+ --out /tmp/test-results/rspec.xml \
135+ $TEST_FILES
136+
137+ - store_test_results :
138+ path : test_results
0 commit comments