-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathconfig.yml
136 lines (123 loc) · 4.02 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
version: 2.1
orbs:
browser-tools: circleci/browser-tools@1.3.0
slack: circleci/slack@4.9.3
# Always take the latest version of the orb, this allows us to
# run specs against Solidus supported versions only without the need
# to change this configuration every time a Solidus version is released
# or goes EOL.
solidusio_extensions: solidusio/extensions@volatile
commands:
setup:
steps:
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- checkout
- run:
name: Install libvips
command: |
sudo apt-get update
sudo apt-get install -yq libvips-dev
test-branch:
description:
Runs tests for a specific Solidus branch.
parameters:
solidus_branch:
type: string
default: master
rails_version:
type: string
ruby_version:
type: string
database:
type: string
steps:
- run:
name: 'Solidus <<parameters.solidus_branch>>: Install gems'
command: |
bundle install
environment:
RAILS_VERSION: <<parameters.rails_version>>
SOLIDUS_BRANCH: <<parameters.solidus_branch>>
when: always
- run:
name: 'Solidus <<parameters.solidus_branch>>: Install sandbox with generated starter frontend'
command: bin/sandbox --seed=false --sample=false
environment:
RAILS_ENV: development # if run in test mode will attempt to eager-load and break the sandbox
RAILS_VERSION: <<parameters.rails_version>>
SOLIDUS_BRANCH: <<parameters.solidus_branch>>
when: always
- run:
name: 'Runs tests on Solidus <<parameters.solidus_branch>>'
command: |
cd sandbox
bundle add rspec_junit_formatter --group test
bundle exec rspec --format progress --format RspecJunitFormatter --out ../test-results/ruby-<<parameters.rails_version>>-rails-<<parameters.rails_version>>-solidus-<<parameters.solidus_branch>>-<<parameters.database>>-results.xml
environment:
RAILS_VERSION: <<parameters.rails_version>>
SOLIDUS_BRANCH: <<parameters.solidus_branch>>
when: always
- run:
command: rm -rf sandbox
name: 'Solidus <<parameters.solidus_branch>>: Clean up'
when: always
notify:
steps:
- slack/notify:
event: fail
template: basic_fail_1
branch_pattern: main, v[0-9]+\.[0-9]+
jobs:
run-specs:
executor:
name: solidusio_extensions/<<parameters.database>>
ruby_version: <<parameters.ruby_version>>
steps:
- setup
- test-branch:
solidus_branch: <<parameters.solidus_branch>>
rails_version: <<parameters.rails_version>>
ruby_version: <<parameters.ruby_version>>
database: <<parameters.database>>
- solidusio_extensions/store-test-results
- notify
parameters:
solidus_branch:
type: string
default: 'master'
rails_version:
type: string
default: '~> 7.0'
ruby_version:
type: string
database:
type: string
workflows:
"Run specs on development Solidus version":
jobs:
- run-specs:
context: slack-secrets
name: run-specs-with-postgres-ruby-3-2
database: 'postgres'
ruby_version: '3.2'
- run-specs:
context: slack-secrets
name: run-specs-with-postgres-ruby-3-1
database: 'postgres'
ruby_version: '3.1'
- run-specs:
context: slack-secrets
name: run-specs-with-postgres-ruby-3-0
database: 'postgres'
ruby_version: '2.7'
- run-specs:
context: slack-secrets
name: run-specs-with-mysql-ruby-3-2
database: 'mysql'
ruby_version: '3.2'
- run-specs:
context: slack-secrets
name: run-specs-with-sqlite-ruby-3-2
database: 'sqlite'
ruby_version: '3.2'