Skip to content

Commit 983c7fd

Browse files
authored
Merge pull request #22 from appsignal/fix-erlang-version-ci
Fix Erlang/OTP and Elixir version in CI
2 parents b3f6809 + 317efa8 commit 983c7fd

File tree

2 files changed

+45
-27
lines changed

2 files changed

+45
-27
lines changed

.semaphore/semaphore.yml

+18-22
Original file line numberDiff line numberDiff line change
@@ -16,78 +16,74 @@ blocks:
1616
- script/lint_git
1717
- name: mix compile --warnings-as-errors
1818
commands:
19-
- ERLANG_VERSION=24.0 ELIXIR_VERSION=1.12.2 bin/setup
19+
- ERLANG_VERSION=24.0 ELIXIR_VERSION=1.12.2 . bin/setup
2020
- mix compile --warnings-as-errors
2121
- name: mix format --check-formatted
2222
commands:
23-
- ERLANG_VERSION=24.0 ELIXIR_VERSION=1.12.2 bin/setup
23+
- ERLANG_VERSION=24.0 ELIXIR_VERSION=1.12.2 . bin/setup
2424
- mix format --check-formatted
2525
- name: mix credo --strict
2626
commands:
27-
- ERLANG_VERSION=24.0 ELIXIR_VERSION=1.12.2 bin/setup
27+
- ERLANG_VERSION=24.0 ELIXIR_VERSION=1.12.2 . bin/setup
2828
- mix credo --strict
2929
- name: mix dialyzer
3030
commands:
31-
- ERLANG_VERSION=24.0 ELIXIR_VERSION=master bin/setup
31+
- ERLANG_VERSION=24.0 ELIXIR_VERSION=main . bin/setup
3232
- cache restore dialyzer-plt
3333
- MIX_ENV=test mix dialyzer --plt
3434
- cache store dialyzer-plt priv/plts/
3535
- MIX_ENV=test mix dialyzer
36-
- name: Elixir master, OTP 24
36+
- name: Elixir main, OTP 24
3737
commands:
38-
- ERLANG_VERSION=24.0 ELIXIR_VERSION=master bin/setup
38+
- ERLANG_VERSION=24.0 ELIXIR_VERSION=main . bin/setup
3939
- mix test
4040
- name: Elixir 1.12.2, OTP 24
4141
commands:
42-
- ERLANG_VERSION=24.0 ELIXIR_VERSION=1.12.2 bin/setup
42+
- ERLANG_VERSION=24.0 ELIXIR_VERSION=1.12.2 . bin/setup
4343
- mix test
4444
- name: Elixir 1.12.2, OTP 23
4545
commands:
46-
- ERLANG_VERSION=23.3 ELIXIR_VERSION=1.12.2 bin/setup
46+
- ERLANG_VERSION=23.3 ELIXIR_VERSION=1.12.2 . bin/setup
4747
- mix test
4848
- name: Elixir 1.12.2, OTP 22
4949
commands:
50-
- ERLANG_VERSION=22.3 ELIXIR_VERSION=1.12.2 bin/setup
50+
- ERLANG_VERSION=22.3 ELIXIR_VERSION=1.12.2 . bin/setup
5151
- mix test
5252
- name: Elixir 1.11.4, OTP 24
5353
commands:
54-
- ERLANG_VERSION=24.0 ELIXIR_VERSION=1.11.4 bin/setup
54+
- ERLANG_VERSION=24.0 ELIXIR_VERSION=1.11.4 . bin/setup
5555
- mix test
5656
- name: Elixir 1.11.4, OTP 23
5757
commands:
58-
- ERLANG_VERSION=23.3 ELIXIR_VERSION=1.11.4 bin/setup
58+
- ERLANG_VERSION=23.3 ELIXIR_VERSION=1.11.4 . bin/setup
5959
- mix test
6060
- name: Elixir 1.11.4, OTP 22
6161
commands:
62-
- ERLANG_VERSION=22.3 ELIXIR_VERSION=1.11.4 bin/setup
62+
- ERLANG_VERSION=22.3 ELIXIR_VERSION=1.11.4 . bin/setup
6363
- mix test
6464
- name: Elixir 1.11.4, OTP 21
6565
commands:
66-
- ERLANG_VERSION=21.3 ELIXIR_VERSION=1.11.4 bin/setup
66+
- ERLANG_VERSION=21.3 ELIXIR_VERSION=1.11.4 . bin/setup
6767
- mix test
6868
- name: Elixir 1.10.4, OTP 23
6969
commands:
70-
- ERLANG_VERSION=23.3 ELIXIR_VERSION=1.10.4 bin/setup
70+
- ERLANG_VERSION=23.3 ELIXIR_VERSION=1.10.4 . bin/setup
7171
- mix test
7272
- name: Elixir 1.10.4, OTP 22
7373
commands:
74-
- ERLANG_VERSION=22.3 ELIXIR_VERSION=1.10.4 bin/setup
74+
- ERLANG_VERSION=22.3 ELIXIR_VERSION=1.10.4 . bin/setup
7575
- mix test
7676
- name: Elixir 1.10.4, OTP 21
7777
commands:
78-
- ERLANG_VERSION=21.3 ELIXIR_VERSION=1.10.4 bin/setup
78+
- ERLANG_VERSION=21.3 ELIXIR_VERSION=1.10.4 . bin/setup
7979
- mix test
8080
- name: Elixir 1.9.4, OTP 22
8181
commands:
82-
- ERLANG_VERSION=22.3 ELIXIR_VERSION=1.9.4 bin/setup
82+
- ERLANG_VERSION=22.3 ELIXIR_VERSION=1.9.4 . bin/setup
8383
- mix test
8484
- name: Elixir 1.9.4, OTP 21
8585
commands:
86-
- ERLANG_VERSION=21.3 ELIXIR_VERSION=1.9.4 bin/setup
87-
- mix test
88-
- name: Elixir 1.9.4, OTP 20
89-
commands:
90-
- ERLANG_VERSION=20.3 ELIXIR_VERSION=1.9.4 bin/setup
86+
- ERLANG_VERSION=21.3 ELIXIR_VERSION=1.9.4 . bin/setup
9187
- mix test
9288
env_vars:
9389
- name: MIX_ENV

bin/setup

+27-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,34 @@
1-
if [[ $ELIXIR_VERSION == "master" ]]; then
2-
kiex install $ELIXIR_VERSION
3-
fi
1+
#!/bin/bash
2+
3+
set -e
4+
5+
elixirs_key="elixir-$ELIXIR_VERSION-erlang-$ERLANG_VERSION-elixirs"
6+
archives_key="elixir-$ELIXIR_VERSION-erlang-$ERLANG_VERSION-archives"
7+
8+
elixirs_path=~/".kiex/elixirs"
9+
archives_path=~/".kiex/mix/archives"
10+
11+
rm -rf "$elixirs_path"/*
12+
rm -rf "$archives_path"/*
413

514
sem-version erlang $ERLANG_VERSION
615
erl -eval '{ok, Version} = file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), "OTP_VERSION"])), io:fwrite(Version), halt().' -noshell
7-
sem-version elixir $ELIXIR_VERSION
16+
17+
if [ $ELIXIR_VERSION != "main" ] && \
18+
cache has_key "$elixirs_key" && \
19+
cache has_key "$archives_key"
20+
then
21+
cache restore "$elixirs_key"
22+
cache restore "$archives_key"
23+
else
24+
kiex install $ELIXIR_VERSION
25+
cache store "$elixirs_key" "$elixirs_path"
26+
cache store "$archives_key" "$archives_path"
27+
fi
28+
29+
kiex use $ELIXIR_VERSION
830
elixir -v
9-
checkout
31+
1032
mix local.rebar --force
1133
mix local.hex --force
1234
mix deps.get

0 commit comments

Comments
 (0)