@@ -58,33 +58,62 @@ jobs:
58
58
runs-on : macos-11
59
59
env :
60
60
MIX_ENV : prod
61
- elixir_version : " 1.15.2 "
61
+ ELIXIR_VERSION : " 1.16.0 "
62
62
strategy :
63
63
matrix :
64
- otp_version : ["25.3.2.3 ", "26.0 .2"]
64
+ otp_version : ["25.3.2.8 ", "26.2 .2"]
65
65
66
66
name : macOS - OTP ${{ matrix.otp_version }}
67
67
68
68
steps :
69
- - uses : actions/checkout@v3
69
+ - uses : actions/checkout@v4
70
+
71
+ - name : Cache OTP
72
+ uses : actions/cache@v3
73
+ id : cache-otp
74
+ with :
75
+ path : ./cache/otp
76
+ key : ${{ runner.os }}-otp-${{ matrix.otp_version }}
70
77
71
- - name : Install erlang and elixir
78
+ - name : Download OTP
79
+ if : steps.cache-otp.outputs.cache-hit != 'true'
72
80
run : |
73
- brew install autoconf coreutils curl git openssl asdf
74
- asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
75
- asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
76
- export KERL_CONFIGURE_OPTIONS="--disable-debug --without-javac"
77
- asdf install erlang ${{ matrix.otp_version }}
78
- asdf install elixir ${{ env.elixir_version }}
79
- asdf global erlang ${{ matrix.otp_version }}
80
- asdf global elixir ${{ env.elixir_version }}
81
- source $(brew --prefix asdf)/libexec/asdf.sh
81
+ mkdir -p ./cache/otp
82
+ 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
83
+ cd ./cache/otp
84
+ tar -xzf otp-v${{ matrix.otp_version }}-x86_64-apple-darwin.tar.gz
85
+
86
+ - name : Cache Elixir
87
+ id : cache-elixir
88
+ uses : actions/cache@v3
89
+ with :
90
+ path : ./cache/elixir
91
+ key : ${{ runner.os }}-elixir-${{ env.ELIXIR_VERSION }}
92
+
93
+ - name : Download and Compile Elixir
94
+ if : steps.cache-elixir.outputs.cache-hit != 'true'
95
+ run : |
96
+ export PATH=$(pwd)/./cache/otp/usr/local/bin:$(pwd)/./cache/elixir/elixir-${{ env.ELIXIR_VERSION }}/bin:${PATH}
97
+ export ERL_ROOTDIR=$(pwd)/./cache/otp/usr/local/lib/erlang
98
+ mkdir -p ./cache/elixir
99
+ 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
100
+ cd ./cache/elixir
101
+ tar -xzf elixir-${{ env.ELIXIR_VERSION }}.tar.gz
102
+ cd elixir-${{ env.ELIXIR_VERSION }}
103
+ make -j$(sysctl -n hw.ncpu) install
104
+
105
+ - name : Install Mix and Rebar
106
+ 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
82
109
mix local.hex --force
83
110
mix local.rebar --force
84
111
85
112
- name : Precompile
86
113
run : |
87
- source $(brew --prefix asdf)/libexec/asdf.sh
114
+ export PATH=$(pwd)/./cache/otp/usr/local/bin:$(pwd)/./cache/elixir/elixir-${{ env.ELIXIR_VERSION }}/bin:${PATH}
115
+ export ERL_ROOTDIR=$(pwd)/./cache/otp/usr/local/lib/erlang
116
+
88
117
export ELIXIR_MAKE_CACHE_DIR=$(pwd)/cache
89
118
mkdir -p "${ELIXIR_MAKE_CACHE_DIR}"
90
119
mix deps.get
0 commit comments