Skip to content

Commit 12f01a2

Browse files
committed
Attempt using a reusable command in circle ci
1 parent 99c34c3 commit 12f01a2

File tree

1 file changed

+47
-15
lines changed

1 file changed

+47
-15
lines changed

.circleci/config.yml

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
1-
version: 2
1+
version: 2.1
2+
3+
commands:
4+
runspecs:
5+
description: "A command for running rake spec"
6+
parameters:
7+
spec_command:
8+
type: string
9+
default: "parallel_spec"
10+
steps:
11+
- checkout
12+
- run: bundle -v
13+
- run: rm -f Gemfile.lock
14+
- run: gem update --system $RUBYGEMS_VERSION
15+
- run: gem --version
16+
- run: bundle -v
17+
- restore_cache:
18+
keys:
19+
- ${CIRCLE_PROJECT_REPONAME}-{{ checksum "Gemfile" }}
20+
- ${CIRCLE_PROJECT_REPONAME}-
21+
- run: bundle install --jobs $(nproc) --path vendor/bundle
22+
- save_cache:
23+
key: ${CIRCLE_PROJECT_REPONAME}-{{ checksum "Gemfile" }}
24+
paths:
25+
- vendor/bundle
26+
- run: bundle exec rake << parameters.spec_command >>
227

328
spec: &spec
429
steps:
@@ -10,40 +35,47 @@ spec: &spec
1035
- run: bundle -v
1136
- restore_cache:
1237
keys:
13-
- pe_databases-{{ checksum "Gemfile" }}
14-
- pe_databases-
38+
- ${CIRCLE_PROJECT_REPONAME}-{{ checksum "Gemfile" }}
39+
- ${CIRCLE_PROJECT_REPONAME}-
1540
- run: bundle install --jobs $(nproc) --path vendor/bundle
1641
- save_cache:
17-
key: pe_databases-{{ checksum "Gemfile" }}
42+
key: ${CIRCLE_PROJECT_REPONAME}-{{ checksum "Gemfile" }}
1843
paths:
1944
- vendor/bundle
2045
- run: bundle exec rake $SPEC
2146

2247
jobs:
2348
lint:
24-
environment:
25-
CHECK: "check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
49+
#environment:
50+
# CHECK: "check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
2651
docker:
2752
- image: circleci/ruby:2.5.3
28-
<<: *spec
29-
parallel_spec_2.5.3:
53+
steps:
54+
- runspecs:
55+
spec_command: "check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
56+
#<<: *spec
57+
parallelspec253:
3058
environment:
31-
SPEC: parallel_spec
3259
PUPPET_GEM_VERSION: "~> 6.0"
3360
docker:
3461
- image: circleci/ruby:2.5.3
35-
<<: *spec
36-
parallel_spec_2.4.5:
62+
steps:
63+
- runspecs:
64+
spec_command: "parallel_spec"
65+
#<<: *spec
66+
parallelspec245:
3767
environment:
38-
SPEC: parallel_spec
3968
PUPPET_GEM_VERSION: "~> 5.0"
4069
docker:
4170
- image: circleci/ruby:2.4.5
42-
<<: *spec
71+
steps:
72+
- runspecs:
73+
spec_command: "parallel_spec"
74+
#<<: *spec
4375
workflows:
4476
version: 2
4577
test:
4678
jobs:
4779
- lint
48-
- parallel_spec_2.5.3
49-
- parallel_spec_2.4.5
80+
- parallelspec253
81+
- parallelspec245

0 commit comments

Comments
 (0)