@@ -77,52 +77,21 @@ jobs:
77
77
ELIXIR_VERSION : " 1.15.7"
78
78
79
79
steps :
80
- - uses : actions/checkout@v4
81
-
82
- - name : Cache OTP
83
- uses : actions/cache@v4
84
- id : cache-otp
85
- with :
86
- path : ./cache/otp
87
- key : ${{ runner.os }}-otp-${{ env.OTP_VERSION }}
80
+ - name : Checkout
81
+ uses : actions/checkout@v4
88
82
89
- - name : Download OTP
90
- if : steps.cache-otp.outputs.cache-hit != 'true'
83
+ - name : Install OTP and Elixir
91
84
run : |
92
- mkdir -p ./cache/otp
93
- curl -fSL https://github.com/cocoa-xu/otp-build/releases/download/v${{ env.OTP_VERSION }}/otp-x86_64-apple-darwin.tar.gz -o ./cache/otp/otp-v${{ env.OTP_VERSION }}-x86_64-apple-darwin.tar.gz
94
- cd ./cache/otp
95
- tar -xzf otp-v${{ env.OTP_VERSION }}-x86_64-apple-darwin.tar.gz
96
-
97
- - name : Cache Elixir
98
- id : cache-elixir
99
- uses : actions/cache@v4
100
- with :
101
- path : ./cache/elixir
102
- key : ${{ runner.os }}-elixir-${{ env.ELIXIR_VERSION }}
85
+ curl -fsSO https://elixir-lang.org/install.sh
86
+ sh install.sh "elixir@${ELIXIR_VERSION}" "otp@${OTP_VERSION}"
103
87
104
- - name : Download and Compile Elixir
105
- if : steps.cache-elixir.outputs.cache-hit != 'true'
88
+ - name : Compile and Test
106
89
run : |
107
- export PATH=$(pwd)/./cache/otp/usr/local/bin:$(pwd)/./cache/elixir/elixir-${{ env.ELIXIR_VERSION }}/bin:${PATH}
108
- export ERL_ROOTDIR=$(pwd)/./cache/otp/usr/local/lib/erlang
109
- mkdir -p ./cache/elixir
110
- 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
111
- cd ./cache/elixir
112
- tar -xzf elixir-${{ env.ELIXIR_VERSION }}.tar.gz
113
- cd elixir-${{ env.ELIXIR_VERSION }}
114
- make -j$(sysctl -n hw.ncpu) install
90
+ export OTP_MAIN_VER="${OTP_VERSION%%.*}"
91
+ export PATH=$HOME/.elixir-install/installs/otp/${OTP_VERSION}/bin:$PATH
92
+ export PATH=$HOME/.elixir-install/installs/elixir/${ELIXIR_VERSION}-otp-${OTP_MAIN_VER}/bin:$PATH
115
93
116
- - name : macOS setup
117
- run : |
118
- export PATH=$(pwd)/./cache/otp/usr/local/bin:$(pwd)/./cache/elixir/elixir-${{ env.ELIXIR_VERSION }}/bin:${PATH}
119
- export ERL_ROOTDIR=$(pwd)/./cache/otp/usr/local/lib/erlang
120
94
mix local.hex --force
121
95
mix local.rebar --force
122
-
123
- - name : Compile and Test
124
- run : |
125
- export PATH=$(pwd)/./cache/otp/usr/local/bin:$(pwd)/./cache/elixir/elixir-${{ env.ELIXIR_VERSION }}/bin:${PATH}
126
- export ERL_ROOTDIR=$(pwd)/./cache/otp/usr/local/lib/erlang
127
96
mix deps.get
128
97
mix test --exclude postgresql
0 commit comments