|
1 | | -version: 2 |
| 1 | +version: 2.1 |
2 | 2 |
|
3 | | -defaults: &defaults |
4 | | - working_directory: ~/repo |
5 | | - environment: |
6 | | - LC_ALL: C.UTF-8 |
7 | | - |
8 | | -install_hex_rebar: &install_hex_rebar |
9 | | - run: |
10 | | - name: Install hex and rebar |
11 | | - command: | |
12 | | - mix local.hex --force |
13 | | - mix local.rebar --force |
14 | | -
|
15 | | -install_system_deps: &install_system_deps |
16 | | - run: |
17 | | - name: Install system dependencies |
18 | | - command: | |
19 | | - apk add build-base linux-headers |
| 3 | +latest: &latest |
| 4 | + pattern: "^1.14.2-erlang-25.*$" |
20 | 5 |
|
21 | 6 | jobs: |
22 | | - build_elixir_1_14_otp_25: |
| 7 | + check-license: |
| 8 | + docker: |
| 9 | + - image: fsfe/reuse:latest |
| 10 | + steps: |
| 11 | + - checkout |
| 12 | + - run: reuse lint |
| 13 | + |
| 14 | + build-test: |
| 15 | + parameters: |
| 16 | + tag: |
| 17 | + type: string |
23 | 18 | docker: |
24 | | - - image: hexpm/elixir:1.14.2-erlang-25.2-alpine-3.17.0 |
25 | | - <<: *defaults |
| 19 | + - image: hexpm/elixir:<< parameters.tag >> |
| 20 | + working_directory: ~/repo |
| 21 | + environment: |
| 22 | + LC_ALL: C.UTF-8 |
26 | 23 | steps: |
| 24 | + - run: |
| 25 | + name: Install system dependencies |
| 26 | + command: apk add --no-cache build-base linux-headers |
27 | 27 | - checkout |
28 | | - - <<: *install_hex_rebar |
29 | | - - <<: *install_system_deps |
| 28 | + - run: |
| 29 | + name: Install hex and rebar |
| 30 | + command: | |
| 31 | + mix local.hex --force |
| 32 | + mix local.rebar --force |
30 | 33 | - restore_cache: |
31 | 34 | keys: |
32 | | - - v1-mix-cache-{{ checksum "mix.lock" }} |
| 35 | + - v1-mix-cache-<< parameters.tag >>-{{ checksum "mix.lock" }} |
33 | 36 | - run: mix deps.get |
34 | | - - run: mix format --check-formatted |
35 | | - - run: mix deps.unlock --check-unused |
36 | | - - run: mix docs |
37 | | - - run: mix hex.build |
38 | 37 | - run: mix test |
39 | | - - run: mix credo -a |
40 | | - - run: mix dialyzer |
| 38 | + - when: |
| 39 | + condition: |
| 40 | + matches: { <<: *latest, value: << parameters.tag >> } |
| 41 | + steps: |
| 42 | + - run: mix format --check-formatted |
| 43 | + - run: mix deps.unlock --check-unused |
| 44 | + - run: mix docs |
| 45 | + - run: mix hex.build |
| 46 | + - run: mix credo -a --strict |
| 47 | + - run: mix dialyzer |
41 | 48 | - save_cache: |
42 | | - key: v1-mix-cache-{{ checksum "mix.lock" }} |
| 49 | + key: v1-mix-cache-<< parameters.tag >>-{{ checksum "mix.lock" }} |
43 | 50 | paths: |
44 | 51 | - _build |
45 | 52 | - deps |
46 | 53 |
|
47 | | - build_elixir_1_13_otp_24: |
48 | | - docker: |
49 | | - - image: hexpm/elixir:1.13.4-erlang-24.3.4-alpine-3.15.3 |
50 | | - <<: *defaults |
51 | | - steps: |
52 | | - - checkout |
53 | | - - <<: *install_hex_rebar |
54 | | - - <<: *install_system_deps |
55 | | - - run: mix deps.get |
56 | | - - run: mix test |
57 | | - |
58 | | - build_elixir_1_12_otp_24: |
59 | | - docker: |
60 | | - - image: hexpm/elixir:1.12.3-erlang-24.3.4.2-alpine-3.16.0 |
61 | | - <<: *defaults |
62 | | - steps: |
63 | | - - checkout |
64 | | - - <<: *install_hex_rebar |
65 | | - - <<: *install_system_deps |
66 | | - - run: mix deps.get |
67 | | - - run: mix test |
68 | | - |
69 | | - build_elixir_1_11_otp_23: |
70 | | - docker: |
71 | | - - image: hexpm/elixir:1.11.4-erlang-23.3.4-alpine-3.13.3 |
72 | | - <<: *defaults |
73 | | - steps: |
74 | | - - checkout |
75 | | - - <<: *install_hex_rebar |
76 | | - - <<: *install_system_deps |
77 | | - - run: mix deps.get |
78 | | - - run: mix test |
79 | | - |
80 | | - build_elixir_1_10_otp_23: |
81 | | - docker: |
82 | | - - image: hexpm/elixir:1.10.4-erlang-23.3.4-alpine-3.13.3 |
83 | | - <<: *defaults |
84 | | - steps: |
85 | | - - checkout |
86 | | - - <<: *install_hex_rebar |
87 | | - - <<: *install_system_deps |
88 | | - - run: mix deps.get |
89 | | - - run: mix test |
90 | | - |
91 | 54 | workflows: |
92 | | - version: 2 |
93 | | - build_test: |
| 55 | + checks: |
94 | 56 | jobs: |
95 | | - - build_elixir_1_14_otp_25 |
96 | | - - build_elixir_1_13_otp_24 |
97 | | - - build_elixir_1_12_otp_24 |
98 | | - - build_elixir_1_11_otp_23 |
99 | | - - build_elixir_1_10_otp_23 |
| 57 | + - check-license |
| 58 | + - build-test: |
| 59 | + name: << matrix.tag >> |
| 60 | + matrix: |
| 61 | + parameters: |
| 62 | + tag: [ |
| 63 | + 1.14.2-erlang-25.2-alpine-3.17.0, |
| 64 | + 1.13.4-erlang-24.3.4-alpine-3.15.3, |
| 65 | + 1.12.3-erlang-24.3.4-alpine-3.15.3, |
| 66 | + 1.11.4-erlang-23.3.4.13-alpine-3.15.3, |
| 67 | + 1.10.4-erlang-23.3.4-alpine-3.13.3 |
| 68 | + ] |
0 commit comments