|
1 |
| -version: 2.0 |
| 1 | +version: 2.1 |
| 2 | + |
| 3 | +default_version: &default_version 1.8.1 |
| 4 | + |
2 | 5 | jobs:
|
3 | 6 | build:
|
| 7 | + parameters: |
| 8 | + version: |
| 9 | + description: Elixir Version |
| 10 | + type: string |
| 11 | + default: *default_version |
| 12 | + parallelism: 1 |
4 | 13 | docker:
|
5 |
| - - image: circleci/elixir:1.8.1 |
6 |
| - environment: |
7 |
| - MIX_ENV: test |
| 14 | + - image: elixir:<< parameters.version >> |
| 15 | + working_directory: ~/app |
| 16 | + |
8 | 17 | steps:
|
9 | 18 | - checkout
|
10 | 19 | - restore_cache:
|
11 | 20 | keys:
|
12 |
| - - v2-dependency-cache-{{ checksum "mix.lock" }} |
| 21 | + - build-<<parameters.version>> |
13 | 22 | - run: mix local.hex --force
|
14 | 23 | - run: mix local.rebar --force
|
15 |
| - - run: mix deps.get |
16 |
| - - run: mix deps.compile |
17 |
| - - run: mix compile |
| 24 | + - run: mix do deps.get, compile |
| 25 | + - save_cache: |
| 26 | + key: build-<<parameters.version>> |
| 27 | + paths: |
| 28 | + - "deps" |
| 29 | + - "_build" |
| 30 | + - "~/.mix" |
| 31 | + - run: mix test |
| 32 | + |
| 33 | + lint: |
| 34 | + parameters: |
| 35 | + version: |
| 36 | + description: Elixir Version |
| 37 | + type: string |
| 38 | + default: *default_version |
| 39 | + parallelism: 1 |
| 40 | + docker: |
| 41 | + - image: elixir:<< parameters.version >> |
| 42 | + working_directory: ~/app |
| 43 | + steps: |
| 44 | + - checkout # check out source code to working directory |
| 45 | + - restore_cache: |
| 46 | + keys: |
| 47 | + - lint-<<parameters.version>>-{{ checksum "mix.lock" }} |
| 48 | + - run: mix local.hex --force |
| 49 | + - run: mix local.rebar --force |
| 50 | + - run: mix do deps.get, compile |
| 51 | + - run: mix dialyzer --halt-exit-status |
18 | 52 | - run: mix credo --strict
|
19 | 53 | - run: mix coveralls.circle
|
20 | 54 | - save_cache:
|
21 |
| - key: v2-dependency-cache-{{ checksum "mix.lock" }} |
| 55 | + key: lint-<<parameters.version>>-{{ checksum "mix.lock" }} |
22 | 56 | paths:
|
23 |
| - - _build |
24 |
| - - deps |
| 57 | + - "deps" |
| 58 | + - "_build" |
| 59 | + - "~/.mix" |
| 60 | + |
| 61 | +workflows: |
| 62 | + version: 2.1 |
| 63 | + testing_all_versions: |
| 64 | + jobs: |
| 65 | + - build: |
| 66 | + name: "Test Elixir 1.8.1" |
| 67 | + version: 1.8.1 |
| 68 | + - build: |
| 69 | + name: "Test Elixir 1.7.4" |
| 70 | + version: 1.7.4 |
| 71 | + - build: |
| 72 | + name: "Test Elixir 1.6.6" |
| 73 | + version: 1.6.6 |
| 74 | + - build: |
| 75 | + name: "Test Elixir 1.5.3" |
| 76 | + version: 1.5.3 |
| 77 | + - build: |
| 78 | + name: "Test Elixir 1.4.5" |
| 79 | + version: 1.4.5 |
| 80 | + - lint: |
| 81 | + name: "Check Formatting, Types and Coverage" |
0 commit comments