|
1 | | -# Elixir CircleCI 2.0 configuration file |
2 | | -# |
3 | | -# Check https://circleci.com/docs/2.0/language-elixir/ for more details |
| 1 | +install_elixir: &install_elixir |
| 2 | + run: |
| 3 | + name: Install Elixir |
| 4 | + command: | |
| 5 | + wget https://repo.hex.pm/builds/elixir/v$ELIXIR_VERSION.zip |
| 6 | + unzip -d /usr/local/elixir v$ELIXIR_VERSION.zip |
| 7 | + echo 'export PATH=/usr/local/elixir/bin:$PATH' >> $BASH_ENV |
| 8 | +
|
| 9 | +install_hex_rebar: &install_hex_rebar |
| 10 | + run: |
| 11 | + name: Install hex and rebar |
| 12 | + command: | |
| 13 | + mix local.hex --force |
| 14 | + mix local.rebar --force |
| 15 | +
|
| 16 | +defaults: &defaults |
| 17 | + working_directory: ~/repo |
| 18 | + |
4 | 19 | version: 2 |
| 20 | + |
5 | 21 | jobs: |
6 | | - build: |
| 22 | + build_elixir_1_8_otp_21: |
7 | 23 | docker: |
8 | | - - image: circleci/elixir:1.6.6 |
9 | | - working_directory: ~/repo |
| 24 | + - image: erlang:21.2.7 |
| 25 | + environment: |
| 26 | + ELIXIR_VERSION: 1.8.1-otp-21 |
| 27 | + LC_ALL: C.UTF-8 |
| 28 | + SUDO: true |
| 29 | + <<: *defaults |
10 | 30 | steps: |
11 | 31 | - checkout |
12 | | - - run: mix local.hex --force && mix local.rebar --force |
13 | | - - run: mix deps.get --only test |
| 32 | + - <<: *install_elixir |
| 33 | + - <<: *install_hex_rebar |
| 34 | + - run: mix deps.get |
| 35 | + - run: mix format --check-formatted |
14 | 36 | - run: mix test |
| 37 | + - run: mix docs |
| 38 | + |
| 39 | + build_elixir_1_7_otp_21: |
| 40 | + docker: |
| 41 | + - image: erlang:21.2.7 |
| 42 | + environment: |
| 43 | + ELIXIR_VERSION: 1.7.4-otp-21 |
| 44 | + LC_ALL: C.UTF-8 |
| 45 | + SUDO: true |
| 46 | + <<: *defaults |
| 47 | + steps: |
| 48 | + - checkout |
| 49 | + - <<: *install_elixir |
| 50 | + - <<: *install_hex_rebar |
| 51 | + - run: mix deps.get |
| 52 | + - run: mix format --check-formatted |
| 53 | + - run: mix test |
| 54 | + - run: mix docs |
| 55 | + |
| 56 | + build_elixir_1_6_otp_21: |
| 57 | + docker: |
| 58 | + - image: erlang:21.2.7 |
| 59 | + environment: |
| 60 | + ELIXIR_VERSION: 1.6.6-otp-21 |
| 61 | + LC_ALL: C.UTF-8 |
| 62 | + SUDO: true |
| 63 | + <<: *defaults |
| 64 | + steps: |
| 65 | + - checkout |
| 66 | + - <<: *install_elixir |
| 67 | + - <<: *install_hex_rebar |
| 68 | + - run: mix deps.get |
| 69 | + - run: mix test |
| 70 | + |
| 71 | + build_elixir_1_6_otp_20: |
| 72 | + docker: |
| 73 | + - image: erlang:20.3.8 |
| 74 | + environment: |
| 75 | + ELIXIR_VERSION: 1.6.6 |
| 76 | + LC_ALL: C.UTF-8 |
| 77 | + SUDO: true |
| 78 | + <<: *defaults |
| 79 | + steps: |
| 80 | + - checkout |
| 81 | + - <<: *install_elixir |
| 82 | + - <<: *install_hex_rebar |
| 83 | + - run: mix deps.get |
| 84 | + - run: mix test |
| 85 | + |
| 86 | +workflows: |
| 87 | + version: 2 |
| 88 | + build_test: |
| 89 | + jobs: |
| 90 | + - build_elixir_1_8_otp_21: |
| 91 | + context: org-global |
| 92 | + - build_elixir_1_7_otp_21: |
| 93 | + context: org-global |
| 94 | + - build_elixir_1_6_otp_21: |
| 95 | + context: org-global |
| 96 | + - build_elixir_1_6_otp_20: |
| 97 | + context: org-global |
0 commit comments