11version : v1.0
2- name : " 💎 Ruby CI Pipeline"
3-
4- # ---------------------------------------------------------------------
5- # GLOBAL SETTINGS
6- # ---------------------------------------------------------------------
2+ name : " \U0001F48E Ruby CI Pipeline"
73agent :
84 machine :
9- type : f1-standard-2
10- os_image : ubuntu2404
11-
5+ type : e1-standard-2
6+ os_image : ubuntu2004
7+ containers :
8+ - name : main
9+ image : ' semaphoreci/ubuntu:20.04'
1210fail_fast :
1311 stop :
1412 when : branch != 'main'
@@ -17,12 +15,9 @@ auto_cancel:
1715 when : branch != 'main'
1816 queued :
1917 when : branch = 'main'
20-
21- # Common pre-steps for every job
2218global_job_config :
2319 prologue :
2420 commands :
25- # Helper: run a command, or sleep N seconds and pass
2621 - |
2722 run_or_pass() {
2823 echo "→ $*"
@@ -35,22 +30,15 @@ global_job_config:
3530 fi
3631 return 0
3732 }
38- - export SLEEP_SEC="${SLEEP_SEC:-12}"
39-
40- # Usual setup, protected by run_or_pass
33+ - ' export SLEEP_SEC="${SLEEP_SEC:-12}"'
4134 - run_or_pass checkout
4235 - run_or_pass "sem-service start postgres 17"
4336 - run_or_pass "sem-service start redis 7"
4437 - run_or_pass "sem-version ruby 3.2.2"
4538 - run_or_pass "sem-version node 20.11.0"
4639 - run_or_pass "cache restore"
47-
48- # ---------------------------------------------------------------------
49- # WORKFLOW
50- # ---------------------------------------------------------------------
5140blocks :
52- # ---------------- SETUP ----------------
53- - name : " 🛠 Setup & Cache"
41+ - name : " \U0001F6E0 Setup & Cache"
5442 task :
5543 jobs :
5644 - name : Install Gems & JS deps
@@ -62,60 +50,49 @@ blocks:
6250 - run_or_pass "gem install --no-document semaphore_test_boosters"
6351 - run_or_pass "cache store"
6452 dependencies : []
65-
66- # ------------- FRONT-END BUILD -------------
67- - name : " 🖼️ Webpacker Build"
53+ - name : " \U0001F5BC ️ Webpacker Build"
6854 task :
6955 jobs :
7056 - name : Compile Assets
7157 commands :
7258 - run_or_pass "cache restore webpacker-assets"
73- - run_or_pass "bundle exec rake webpacker:compile"
59+ - ' run_or_pass "bundle exec rake webpacker:compile"'
7460 - run_or_pass "cache store webpacker-assets public/packs"
75- dependencies :
76- - " 🛠 Setup & Cache"
77-
78- # ------------- CODE QUALITY -------------
79- - name : " 🔍 ESLint & Stylelint"
61+ dependencies : []
62+ - name : " \U0001F50D ESLint & Stylelint"
8063 task :
8164 jobs :
8265 - name : JS / CSS Lint
8366 commands :
8467 - run_or_pass "yarn run eslint ."
8568 - run_or_pass "yarn run stylelint '**/*.scss'"
8669 dependencies :
87- - " 🖼️ Webpacker Build"
88-
89- - name : " 🧹 RuboCop"
70+ - " \U0001F5BC ️ Webpacker Build"
71+ - name : " \U0001F9F9 RuboCop"
9072 task :
9173 jobs :
9274 - name : Ruby Style Check
9375 commands :
9476 - run_or_pass "bundle exec rubocop"
9577 dependencies :
96- - " 🛠 Setup & Cache"
97-
98- # ------------- SECURITY -------------
99- - name : " 🛡️ Brakeman"
78+ - " \U0001F6E0 Setup & Cache"
79+ - name : " \U0001F6E1 ️ Brakeman"
10080 task :
10181 jobs :
10282 - name : Static Analysis
10383 commands :
10484 - run_or_pass "bundle exec brakeman --force"
10585 dependencies :
106- - " 🛠 Setup & Cache"
107-
108- - name : " 🛡️ Bundler Audit"
86+ - " \U0001F6E0 Setup & Cache"
87+ - name : " \U0001F6E1 ️ Bundler Audit"
10988 task :
11089 jobs :
11190 - name : Gem CVE Check
11291 commands :
11392 - run_or_pass "bundle exec bundle-audit check --update"
11493 dependencies :
115- - " 🛠 Setup & Cache"
116-
117- # ------------- TEST SUITE (Boosters) -------------
118- - name : " 🚦 RSpec Suite"
94+ - " \U0001F6E0 Setup & Cache"
95+ - name : " \U0001F6A6 RSpec Suite"
11996 task :
12097 env_vars :
12198 - name : RAILS_ENV
@@ -125,21 +102,19 @@ blocks:
125102 - name : PGUSER
126103 value : postgres
127104 jobs :
128- - name : " 🟢 RSpec Tests"
105+ - name : " \U0001F7E2 RSpec Tests"
129106 parallelism : 5
130107 commands :
131108 - run_or_pass "cache restore webpacker-assets"
132- - run_or_pass "bundle exec rake db:setup"
133- # Try to run split tests with Boosters; if unavailable, sleep and pass
109+ - ' run_or_pass "bundle exec rake db:setup"'
134110 - run_or_pass 'rspec_booster --job "$SEMAPHORE_JOB_INDEX/$SEMAPHORE_JOB_COUNT" --format RspecJunitFormatter --out report.xml --format documentation'
135111 dependencies :
136- - " 🧹 RuboCop"
137- - " 🛡️ Brakeman"
138- - " 🛡️ Bundler Audit"
139- - " 🖼️ Webpacker Build"
140-
112+ - " \U0001F9F9 RuboCop"
113+ - " \U0001F6E1 ️ Brakeman"
114+ - " \U0001F6E1 ️ Bundler Audit"
115+ - " \U0001F5BC ️ Webpacker Build"
141116promotions :
142- - name : Production
143- pipeline_file : production.yml
144- auto_promote :
145- when : " result = 'passed' and branch = 'master'"
117+ - name : Production
118+ pipeline_file : production.yml
119+ auto_promote :
120+ when : result = 'passed' and branch = 'master'
0 commit comments