Admin: remove unused JS code (#12383)
[spree.git] / .circleci / config.yml
blobf3284837172909949a88f36f5ae4c6436afe9900
1 version: 2.1
3 defaults: &defaults
4   parameters: &default_parameters
5     restore_cache_key_1:
6       type: string
7       default: 'spree-bundle-v10-ruby-{{ checksum ".ruby-version" }}-{{ .Branch }}'
8     restore_cache_key_2:
9       type: string
10       default: 'spree-bundle-v10-ruby-{{ checksum ".ruby-version" }}'
11     save_cache_key:
12       type: string
13       default: 'spree-bundle-v10-ruby-{{ checksum ".ruby-version" }}-{{ .Branch }}'
14     run_file_path:
15       type: string
16     rails_version:
17       type: string
18       default: '~> 7.2.0'
19     store_artefacts:
20       type: boolean
21       default: false
22   environment: &environment
23     CIRCLE_TEST_REPORTS: /tmp/test-results
24     CIRCLE_ARTIFACTS: /tmp/test-artifacts
25     BUNDLE_JOBS: 4
26     BUNDLE_RETRY: 3
27     BUNDLE_PATH: ~/spree/vendor/bundle
28     RAILS_VERSION: << parameters.rails_version >>
29     DB: postgres # default value, this will speed up bundle install for all postgres builds
30     DB_HOST: localhost
31     DB_USERNAME: postgres
32     
33   working_directory: ~/spree
34   docker:
35     - image: &ruby_image cimg/ruby:3.3.0-browsers
37 jobs:
38   run_test: &run_test
39     <<: *defaults
40     steps: &default_steps
41       - checkout
42       - attach_workspace:
43           at: /tmp
44       - restore_cache:
45           keys:
46             - << parameters.restore_cache_key_1 >>
47             - << parameters.restore_cache_key_2 >>
48       - run:
49           name: Allow executing given file
50           command: chmod +x << parameters.run_file_path >>
51       - run:
52           name: Run << parameters.run_file_path >> file
53           command: bash << parameters.run_file_path >>
54       - when:
55           condition: << parameters.save_cache_key >>
56           steps:
57             - save_cache:
58                 key: << parameters.save_cache_key >>
59                 paths:
60                   - ~/spree/vendor/bundle
61       - when:
62           condition: <<  parameters.store_artefacts >>
63           steps:
64             - store_artifacts:
65                 path: /tmp/test-artifacts
66                 destination: test-artifacts
67             - store_artifacts:
68                 path: /tmp/failed_tests
69                 destination: failed_tests
70             - store_artifacts:
71                 path: /tmp/test-results
72                 destination: raw-test-output
73             - store_test_results:
74                 path: /tmp/test-results
76   tests_core:
77     <<: *run_test
78     docker:
79       - image: *ruby_image
80       - image: cimg/postgres:16.2
81         environment:
82           POSTGRES_USER: postgres
83     parallelism: 6
84     environment:
85       <<: *environment
86       PROJECTS: core
88   tests_api:
89     <<: *run_test
90     parallelism: 4
91     docker:
92       - image: *ruby_image
93       - image: cimg/postgres:16.2
94         environment:
95           POSTGRES_USER: postgres
96     environment:
97       <<: *environment
98       PROJECTS: api
100   tests_admin:
101     <<: *run_test
102     docker:
103       - image: *ruby_image
104       - image: cimg/postgres:16.2
105         environment:
106           POSTGRES_USER: postgres
107     environment:
108       <<: *environment
109       PROJECTS: admin
111   tests_storefront:
112     <<: *run_test
113     docker:
114       - image: *ruby_image
115       - image: cimg/postgres:16.2
116         environment:
117           POSTGRES_USER: postgres
118     environment:
119       <<: *environment
120       PROJECTS: storefront
122   tests_other:
123     <<: *run_test
124     docker:
125       - image: *ruby_image
126       - image: cimg/postgres:16.2
127         environment:
128           POSTGRES_USER: postgres
129     environment:
130       <<: *environment
131       PROJECTS: emails,sample
133   # tests_mysql:
134   #   <<: *run_test
135   #   parallelism: 12
136   #   parameters:
137   #     <<: *default_parameters
138   #   environment:
139   #     <<: *environment_mysql
140   #   docker:
141   #     - image: *ruby_image
142   #     - image: cimg/mysql:8.0
143   #       command: [--default-authentication-plugin=mysql_native_password]
145 workflows:
146   main:
147     jobs:
148       - run_test:
149           name: build
150           run_file_path: ./bin/bundle_ruby.sh
151       - tests_core:
152           name: tests_rails_postgres_core
153           store_artefacts: true
154           run_file_path: ./bin/tests_database_ci.sh
155           requires:
156             - build
157       - tests_api:
158           name: tests_rails_postgres_api
159           store_artefacts: true
160           run_file_path: ./bin/tests_database_ci.sh
161           requires:
162             - build
163       - tests_admin:
164           name: tests_rails_postgres_admin
165           store_artefacts: true
166           run_file_path: ./bin/tests_database_ci.sh
167           requires:
168             - build
169       - tests_storefront:
170           name: tests_rails_postgres_storefront
171           store_artefacts: true
172           run_file_path: ./bin/tests_database_ci.sh
173           requires:
174             - build
175       - tests_other:
176           name: tests_rails_postgres_other
177           store_artefacts: true
178           run_file_path: ./bin/tests_database_ci.sh
179           requires:
180             - build
181       - run_test:
182           name: brakeman
183           restore_cache_key_1: spree-brakeman-{{ .Branch }}
184           restore_cache_key_2: spree-brakeman
185           save_cache_key: spree-brakeman-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
186           run_file_path: ./bin/brakeman.sh
187           requires:
188             - build
189             - tests_rails_postgres_core
190             - tests_rails_postgres_api
191             - tests_rails_postgres_admin
192             - tests_rails_postgres_storefront
193             - tests_rails_postgres_other