@@ -9,97 +9,80 @@ permissions:
9
9
contents : write
10
10
11
11
jobs :
12
- precompile :
13
- runs-on : ${{ matrix.job.os }}
12
+ linux :
13
+ name : Linux Erlang/OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
14
+ runs-on : ubuntu-20.04
14
15
env :
15
16
MIX_ENV : " prod"
16
-
17
- name : Precompile for Elixir ${{ matrix.job.elixir }}, OTP ${{ matrix.job.otp }}, OS ${{ matrix.job.os }}
18
17
strategy :
19
- fail-fast : false
20
18
matrix :
21
- job :
22
- - { os: "ubuntu-20.04", otp: "23", elixir: "1.14" }
23
- - { os: "macos-12", otp: "24.3.4.16", elixir: "1.14.3"}
24
- - { os: "windows-2019", otp: "25", elixir: "1.14"}
19
+ # Elixir 1.14.5 is first version compatible with OTP 26
20
+ # NIF versions change according to
21
+ # https://github.com/erlang/otp/blob/dd57c853a324a9572a9e5ce227d8675ff004c6fe/erts/emulator/beam/erl_nif.h#L33
22
+ otp : ["25.0", "26.0"]
23
+ elixir : ["1.14.5"]
25
24
steps :
26
25
- uses : actions/checkout@v3
27
26
- uses : erlef/setup-beam@v1
28
- if : matrix.job.os != 'macos-12'
29
27
with :
30
- otp-version : ${{ matrix.job.otp }}
31
- elixir-version : ${{ matrix.job.elixir }}
32
- - name : Install erlang and elixir
33
- if : matrix.job.os == 'macos-12'
34
- run : |
35
- export ROOT_DIR=$(pwd)
36
-
37
- mkdir -p ./cache/otp
38
- curl -fSL https://github.com/cocoa-xu/otp-build/releases/download/v${{ matrix.job.otp }}/otp-x86_64-apple-darwin.tar.gz -o ./cache/otp/otp-v${{ matrix.job.otp }}-x86_64-apple-darwin.tar.gz
39
- cd ./cache/otp
40
- tar -xzf otp-v${{ matrix.job.otp }}-x86_64-apple-darwin.tar.gz
41
- cd ${ROOT_DIR}
42
-
43
- export PATH=$(pwd)/cache/otp/usr/local/bin:$(pwd)/./cache/elixir/elixir-${{ matrix.job.elixir }}/bin:${PATH}
44
- export ERL_ROOTDIR=$(pwd)/cache/otp/usr/local/lib/erlang
45
-
46
- mkdir -p ./cache/elixir
47
- curl -fSL https://github.com/elixir-lang/elixir/archive/refs/tags/v${{ matrix.job.elixir }}.tar.gz -o ./cache/elixir/elixir-${{ matrix.job.elixir }}.tar.gz
48
- cd ./cache/elixir
49
- tar -xzf elixir-${{ matrix.job.elixir }}.tar.gz
50
- cd elixir-${{ matrix.job.elixir }}
51
- make compile
52
- make -j$(sysctl -n hw.ncpu) install
53
-
54
- mix local.hex --force
55
- mix local.rebar --force
56
-
57
- - uses : ilammy/msvc-dev-cmd@v1
58
- if : matrix.job.os == 'windows-2019'
59
- with :
60
- arch : x64
61
-
62
- - name : Install system dependencies
63
- if : matrix.job.os == 'ubuntu-20.04'
28
+ otp-version : ${{matrix.otp}}
29
+ elixir-version : ${{matrix.elixir}}
30
+ - name : Install system dependecies
64
31
run : |
65
32
sudo apt-get update
66
- sudo apt-get install -y build-essential automake autoconf pkg-config bc m4 unzip zip wget \
67
- gcc g++ \
68
- gcc-i686-linux-gnu g++-i686-linux-gnu \
33
+ sudo apt-get install -y build-essential automake autoconf pkg-config bc m4 unzip zip \
69
34
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
70
- gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf \
71
- gcc-riscv64-linux-gnu g++-riscv64-linux-gnu \
72
- gcc-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu \
73
- gcc-s390x-linux-gnu g++-s390x-linux-gnu
74
-
75
- - name : Get musl cross-compilers
76
- if : matrix.job.os == 'ubuntu-20.04'
35
+ gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
36
+ - name : Mix Test
77
37
run : |
78
- for musl_arch in x86_64 aarch64 riscv64
79
- do
80
- wget "https://musl.cc/${musl_arch}-linux-musl-cross.tgz" -O "${musl_arch}-linux-musl-cross.tgz"
81
- tar -xf "${musl_arch}-linux-musl-cross.tgz"
82
- done
83
-
38
+ mix deps.get
39
+ MIX_ENV=test mix test
84
40
- name : Create precompiled library
85
- shell : bash
86
41
run : |
87
- if [ "${{ matrix.job.os }}" = "macos-12" ]; then
88
- export PATH=$(pwd)/cache/otp/usr/local/bin:$(pwd)/./cache/elixir/elixir-${{ matrix.job.elixir }}/bin:${PATH}
89
- export ERL_ROOTDIR=$(pwd)/cache/otp/usr/local/lib/erlang
90
- elif [ "${{ matrix.job.os }}" = "ubuntu-20.04" ]; then
91
- for musl_arch in x86_64 aarch64 riscv64
92
- do
93
- export PATH="$(pwd)/${musl_arch}-linux-musl-cross/bin:${PATH}"
94
- done
95
- fi
96
42
export ELIXIR_MAKE_CACHE_DIR=$(pwd)/cache
97
43
mkdir -p "${ELIXIR_MAKE_CACHE_DIR}"
98
- mix deps.get
99
44
mix elixir_make.precompile
100
-
101
45
- uses : softprops/action-gh-release@v1
102
46
if : startsWith(github.ref, 'refs/tags/')
103
47
with :
104
48
files : |
105
49
cache/*.tar.gz
50
+ macos :
51
+ runs-on : ${{matrix.runner}}
52
+ # Homebrew supports versioned Erlang/OTP but not Elixir
53
+ # It's a deliberate design decision from Homebrew to
54
+ # only support versioned distrinutions for certin packages
55
+ name : Mac (${{ matrix.runner == 'macos-13' && 'Intel' || 'ARM' }}) Erlang/OTP ${{matrix.otp}} / Elixir
56
+ env :
57
+ MIX_ENV : " prod"
58
+ strategy :
59
+ matrix :
60
+ runner : ["macos-13", "macos-14"]
61
+ otp : ["25.0", "26.0"]
62
+ elixir : ["1.14.5"]
63
+ steps :
64
+ - uses : actions/checkout@v3
65
+ - uses : asdf-vm/actions/install@v2
66
+ with :
67
+ tool_versions : |
68
+ erlang ${{matrix.otp}}
69
+ elixir ${{matrix.elixir}}
70
+ - name : Install libomp
71
+ run : |
72
+ brew install libomp
73
+ mix local.hex --force
74
+ mix local.rebar --force
75
+ - name : Mix Test
76
+ run : |
77
+ mix deps.get
78
+ MIX_ENV=test mix test
79
+ - name : Create precompiled library
80
+ run : |
81
+ export ELIXIR_MAKE_CACHE_DIR=$(pwd)/cache
82
+ mkdir -p "${ELIXIR_MAKE_CACHE_DIR}"
83
+ mix elixir_make.precompile
84
+ - uses : softprops/action-gh-release@v1
85
+ if : startsWith(github.ref, 'refs/tags/')
86
+ with :
87
+ files : |
88
+ ${{ matrix.runner == 'macos-13' && 'cache/*x86_64*.tar.gz' || 'cache/*aarch64*.tar.gz' }}
0 commit comments