Skip to content

Commit 0e25c33

Browse files
authored
chore(ci): use installer from elixir-lang.org (#19)
Signed-off-by: Cocoa <[email protected]>
1 parent 6b214ce commit 0e25c33

File tree

1 file changed

+10
-40
lines changed

1 file changed

+10
-40
lines changed

.github/workflows/macos-x86_64.yml

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -22,60 +22,30 @@ concurrency:
2222

2323
jobs:
2424
mix_test:
25-
runs-on: macos-12
25+
runs-on: macos-13
2626
env:
2727
TFLITE_BEAM_CORAL_SUPPORT: "true"
2828
TFLITE_BEAM_PREFER_PRECOMPILED: "true"
2929
OTP_VERSION: "26.2.1"
3030
ELIXIR_VERSION: "1.16.0"
3131

3232
steps:
33-
- uses: actions/checkout@v4
33+
- name: Checkout
34+
uses: actions/checkout@v4
3435

35-
- name: Cache OTP
36-
uses: actions/cache@v3
37-
id: cache-otp
38-
with:
39-
path: ./cache/otp
40-
key: ${{ runner.os }}-otp-${{ env.OTP_VERSION }}
41-
42-
- name: Download OTP
43-
if: steps.cache-otp.outputs.cache-hit != 'true'
36+
- name: Install OTP and Elixir
4437
run: |
45-
mkdir -p ./cache/otp
46-
curl -fSL https://cocoa.build/otp/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
47-
cd ./cache/otp
48-
tar -xzf otp-v${{ env.OTP_VERSION }}-x86_64-apple-darwin.tar.gz
49-
50-
- name: Cache Elixir
51-
id: cache-elixir
52-
uses: actions/cache@v3
53-
with:
54-
path: ./cache/elixir
55-
key: ${{ runner.os }}-elixir-${{ env.ELIXIR_VERSION }}
38+
curl -fsSO https://elixir-lang.org/install.sh
39+
sh install.sh "elixir@${ELIXIR_VERSION}" "otp@${OTP_VERSION}"
5640
57-
- name: Download and Compile Elixir
58-
if: steps.cache-elixir.outputs.cache-hit != 'true'
41+
- name: Compile and Test
5942
run: |
60-
export PATH=$(pwd)/./cache/otp/usr/local/bin:$(pwd)/./cache/elixir/elixir-${{ env.ELIXIR_VERSION }}/bin:${PATH}
61-
export ERL_ROOTDIR=$(pwd)/./cache/otp/usr/local/lib/erlang
62-
mkdir -p ./cache/elixir
63-
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
64-
cd ./cache/elixir
65-
tar -xzf elixir-${{ env.ELIXIR_VERSION }}.tar.gz
66-
cd elixir-${{ env.ELIXIR_VERSION }}
67-
make -j$(sysctl -n hw.ncpu) install
43+
export OTP_MAIN_VER="${OTP_VERSION%%.*}"
44+
export PATH=$HOME/.elixir-install/installs/otp/${OTP_VERSION}/bin:$PATH
45+
export PATH=$HOME/.elixir-install/installs/elixir/${ELIXIR_VERSION}-otp-${OTP_MAIN_VER}/bin:$PATH
6846
69-
- name: Install Mix and Rebar
70-
run: |
71-
export PATH=$(pwd)/./cache/otp/usr/local/bin:$(pwd)/./cache/elixir/elixir-${{ env.ELIXIR_VERSION }}/bin:${PATH}
72-
export ERL_ROOTDIR=$(pwd)/./cache/otp/usr/local/lib/erlang
7347
mix local.hex --force
7448
mix local.rebar --force
7549
76-
- name: Compile and Test
77-
run: |
78-
export PATH=$(pwd)/./cache/otp/usr/local/bin:$(pwd)/./cache/elixir/elixir-${{ env.ELIXIR_VERSION }}/bin:${PATH}
79-
export ERL_ROOTDIR=$(pwd)/./cache/otp/usr/local/lib/erlang
8050
mix deps.get
8151
mix test

0 commit comments

Comments
 (0)