Skip to content

Commit 8615795

Browse files
committed
wip: matrix parameters
1 parent 4d4d5fb commit 8615795

1 file changed

Lines changed: 106 additions & 125 deletions

File tree

.circleci/config.yml

Lines changed: 106 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,117 @@
1-
# Ruby CircleCI 2.0 configuration file
2-
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
31
version: 2.1
42

53
orbs:
64
win: circleci/windows@2.2.0
75

8-
common_build_config: &common_build_config
9-
# Specify service dependencies here if necessary
10-
# CircleCI maintains a library of pre-built images
11-
# documented at https://circleci.com/docs/2.0/circleci-images/
12-
docker:
13-
- image: veracross/circleci-ruby-freetds:latest
14-
- image: metaskills/mssql-server-linux-tinytds:2017-GA
15-
16-
working_directory: ~/repo
17-
18-
steps:
19-
- checkout
20-
21-
- restore_cache:
22-
name: restore gem cache
23-
keys:
24-
- v1-bundle-{{ .Branch }}-{{ checksum "tiny_tds.gemspec" }}
25-
- v1-bundle-{{ .Branch }}-
26-
- v1-bundle-
27-
28-
- run:
29-
name: install dependencies
30-
command: |
31-
bundle check --path ./vendor/bundle || bundle install --jobs=3 --retry=3 --path vendor/bundle
32-
bundle clean
33-
34-
- save_cache:
35-
name: save gem cache
36-
paths:
37-
- ./vendor/bundle
38-
key: v1-bundle-{{ .Branch }}-{{ checksum "tiny_tds.gemspec" }}
39-
40-
- run:
41-
name: build gem
42-
command: |
43-
bundle exec rake build
44-
45-
- run:
46-
name: run tests
47-
command: |
48-
TINYTDS_UNIT_HOST=localhost bundle exec rake test
49-
50-
windows_gem_test_config: &windows_gem_test_config
51-
executor:
52-
name: win/default
53-
shell: powershell.exe
54-
55-
steps:
56-
- run: systeminfo
57-
58-
- run: pwd
59-
60-
- checkout
61-
62-
- restore_cache:
63-
name: restore gem cache
64-
keys:
65-
- v1-bundle-{{ .Branch }}-{{ checksum "tiny_tds.gemspec" }}
66-
- v1-bundle-{{ .Branch }}-
67-
- v1-bundle-
68-
69-
- run:
70-
name: install dependencies
71-
command: |
72-
bundle install --jobs=3 --retry=3 --path ./vendor/bundle
73-
bundle clean
74-
75-
- save_cache:
76-
name: save gem cache
77-
paths:
78-
- ./vendor/bundle
79-
key: v1-bundle-{{ .Branch }}-{{ checksum "tiny_tds.gemspec" }}
80-
81-
- run:
82-
name: build prereqs
83-
command: |
84-
bundle exec rake ports
85-
86-
- run:
87-
name: build gem
88-
command: |
89-
bundle exec rake build
90-
91-
- run:
92-
name: run tests
93-
command: |
94-
TINYTDS_UNIT_HOST=localhost bundle exec rake test
95-
966
jobs:
97-
ruby_27:
98-
<<: *common_build_config
99-
docker:
100-
- image: veracross/circleci-ruby-freetds:2.7
101-
- image: metaskills/mssql-server-linux-tinytds:2017-GA
102-
ruby_26:
103-
<<: *common_build_config
104-
docker:
105-
- image: veracross/circleci-ruby-freetds:2.6
106-
- image: metaskills/mssql-server-linux-tinytds:2017-GA
107-
ruby_25:
108-
<<: *common_build_config
7+
test_linux:
8+
parameters:
9+
ruby_version:
10+
description: "version tag for the veracross/circleci-ruby-freetds container"
11+
type: string
12+
10913
docker:
110-
- image: veracross/circleci-ruby-freetds:2.5.3
14+
- image: veracross/circleci-ruby-freetds:latest
11115
- image: metaskills/mssql-server-linux-tinytds:2017-GA
112-
test_windows_ruby_25:
113-
<<: *windows_gem_test_config
16+
17+
working_directory: ~/repo
18+
19+
steps:
20+
- checkout
21+
22+
- restore_cache:
23+
name: restore gem cache
24+
keys:
25+
- v1-bundle-<< parameters.ruby_version >>-{{ .Branch }}-{{ checksum "tiny_tds.gemspec" }}
26+
- v1-bundle-<< parameters.ruby_version >>-{{ .Branch }}-
27+
- v1-bundle-<< parameters.ruby_version >>-
28+
29+
- run:
30+
name: install dependencies
31+
command: |
32+
bundle check --path ./vendor/bundle || bundle install --jobs=3 --retry=3 --path vendor/bundle
33+
bundle clean
34+
35+
- save_cache:
36+
name: save gem cache
37+
paths:
38+
- ./vendor/bundle
39+
key: v1-bundle-<< parameters.ruby_version >>-{{ .Branch }}-{{ checksum "tiny_tds.gemspec" }}
40+
41+
- run:
42+
name: build gem
43+
command: |
44+
bundle exec rake build
45+
46+
- run:
47+
name: run tests
48+
command: |
49+
TINYTDS_UNIT_HOST=localhost bundle exec rake test
50+
51+
test_windows:
52+
parameters:
53+
ruby_version:
54+
description: "version tag for the veracross/circleci-ruby-freetds container"
55+
type: string
56+
57+
executor:
58+
name: win/default
59+
shell: powershell.exe
60+
61+
steps:
62+
- run: systeminfo
63+
64+
- run: pwd
65+
66+
- checkout
67+
68+
- restore_cache:
69+
name: restore gem cache
70+
keys:
71+
- v1-bundle-<< parameters.ruby_version >>-{{ .Branch }}-{{ checksum "tiny_tds.gemspec" }}
72+
- v1-bundle-<< parameters.ruby_version >>-{{ .Branch }}-
73+
- v1-bundle-<< parameters.ruby_version >>-
74+
75+
- run:
76+
name: install dependencies
77+
command: |
78+
bundle install --jobs=3 --retry=3 --path ./vendor/bundle
79+
bundle clean
80+
81+
- save_cache:
82+
name: save gem cache
83+
paths:
84+
- ./vendor/bundle
85+
key: v1-bundle-<< parameters.ruby_version >>-{{ .Branch }}-{{ checksum "tiny_tds.gemspec" }}
86+
87+
- run:
88+
name: build prereqs
89+
command: |
90+
bundle exec rake ports
91+
92+
- run:
93+
name: build gem
94+
command: |
95+
bundle exec rake build
96+
97+
- run:
98+
name: run tests
99+
command: |
100+
TINYTDS_UNIT_HOST=localhost bundle exec rake test
114101
115102
workflows:
116-
version: 2
117-
tinyds:
103+
test_supported_ruby_versions:
118104
jobs:
119-
- ruby_27
120-
# - ruby_26
121-
# - ruby_25
122-
- windows_test
123-
124-
125-
126-
127-
128-
# - run:
129-
# name: "Check docker"
130-
# shell: powershell.exe
131-
# command: |
132-
# docker info
133-
# - run:
134-
# name: run sql server image
135-
# command: |
136-
# docker run -d -p 1433:1433 -e sa_password=<SA_PASSWORD> -e ACCEPT_EULA=Y microsoft/mssql-server-windows-developer
105+
- test_linux:
106+
matrix:
107+
parameters:
108+
ruby_version:
109+
- '2.5.3'
110+
- '2.7'
111+
112+
- test_windows:
113+
matrix:
114+
parameters:
115+
ruby_version:
116+
- '2.5.3'
117+
- '2.7'

0 commit comments

Comments
 (0)