@@ -33,44 +33,17 @@ jobs:
33
33
- name : Checkout
34
34
uses : actions/checkout@v4
35
35
36
- - name : Cache OTP
37
- uses : actions/cache@v3
38
- id : cache-otp
39
- with :
40
- path : ./cache/otp
41
- key : ${{ runner.os }}-otp-${{ matrix.otp_version }}
42
-
43
36
- name : Download OTP
44
- if : steps.cache-otp.outputs.cache-hit != 'true'
45
- run : |
46
- mkdir -p ./cache/otp
47
- curl -fSL https://github.com/cocoa-xu/otp-build/releases/download/v${{ matrix.otp_version }}/otp-x86_64-apple-darwin.tar.gz -o ./cache/otp/otp-v${{ matrix.otp_version }}-x86_64-apple-darwin.tar.gz
48
- cd ./cache/otp
49
- tar -xzf otp-v${{ matrix.otp_version }}-x86_64-apple-darwin.tar.gz
50
-
51
- - name : Cache Elixir
52
- id : cache-elixir
53
- uses : actions/cache@v3
54
- with :
55
- path : ./cache/elixir
56
- key : ${{ runner.os }}-elixir-${{ env.ELIXIR_VERSION }}
57
-
58
- - name : Download and Compile Elixir
59
- if : steps.cache-elixir.outputs.cache-hit != 'true'
60
37
run : |
61
- export PATH=$(pwd)/./cache/otp/usr/local/bin:$(pwd)/./cache/elixir/elixir-${{ env.ELIXIR_VERSION }}/bin:${PATH}
62
- export ERL_ROOTDIR=$(pwd)/./cache/otp/usr/local/lib/erlang
63
- mkdir -p ./cache/elixir
64
- curl -fSL https://github.com/elixir-lang/elixir/archive/refs/tags/v${{ env.ELIXIR_VERSION }}.tar.gz -o ./cache/elixir/elixir-${{ env.ELIXIR_VERSION }}.tar.gz
65
- cd ./cache/elixir
66
- tar -xzf elixir-${{ env.ELIXIR_VERSION }}.tar.gz
67
- cd elixir-${{ env.ELIXIR_VERSION }}
68
- make -j$(sysctl -n hw.ncpu) install
38
+ curl -fsSO https://elixir-lang.org/install.sh
39
+ sh install.sh "elixir@${{ env.ELIXIR_VERSION }}" "otp@${{ matrix.otp_version }}"
69
40
70
41
- name : Install Mix and Rebar
71
42
run : |
72
- export PATH=$(pwd)/./cache/otp/usr/local/bin:$(pwd)/./cache/elixir/elixir-${{ env.ELIXIR_VERSION }}/bin:${PATH}
73
- export ERL_ROOTDIR=$(pwd)/./cache/otp/usr/local/lib/erlang
43
+ export OTP_VERSION=${{ matrix.otp_version }}
44
+ export OTP_MAIN_VER="${OTP_VERSION%%.*}"
45
+ export PATH=$HOME/.elixir-install/installs/otp/${{ matrix.otp_version }}/bin:$PATH
46
+ export PATH=$HOME/.elixir-install/installs/elixir/${{ env.ELIXIR_VERSION }}-otp-${OTP_MAIN_VER}/bin:$PATH
74
47
mix local.hex --force
75
48
mix local.rebar --force
76
49
82
55
83
56
- name : Compile and Test
84
57
run : |
85
- export PATH=$(pwd)/./cache/otp/usr/local/bin:$(pwd)/./cache/elixir/elixir-${{ env.ELIXIR_VERSION }}/bin:${PATH}
86
- export ERL_ROOTDIR=$(pwd)/./cache/otp/usr/local/lib/erlang
58
+ export OTP_VERSION=${{ matrix.otp_version }}
59
+ export OTP_MAIN_VER="${OTP_VERSION%%.*}"
60
+ export PATH=$HOME/.elixir-install/installs/otp/${{ matrix.otp_version }}/bin:$PATH
61
+ export PATH=$HOME/.elixir-install/installs/elixir/${{ env.ELIXIR_VERSION }}-otp-${OTP_MAIN_VER}/bin:$PATH
87
62
88
63
mix deps.get
89
64
mix deps.compile
0 commit comments