-
Notifications
You must be signed in to change notification settings - Fork 7
86 lines (83 loc) · 2.8 KB
/
precompile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: precompile
on: push
jobs:
linux:
name: Linux Erlang/OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
runs-on: ubuntu-20.04
env:
MIX_ENV: "prod"
strategy:
matrix:
# Elixir 1.14.5 is first version compatible with OTP 26
# NIF versionsss change according to
# https://github.com/erlang/otp/blob/dd57c853a324a9572a9e5ce227d8675ff004c6fe/erts/emulator/beam/erl_nif.h#L33
otp: ["25.0", "26.0"]
elixir: ["1.14.5"]
steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Install system dependecies
run: |
sudo apt-get update
sudo apt-get install -y build-essential automake autoconf pkg-config bc m4 unzip zip \
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
- name: Mix Test
run: |
mix deps.get
MIX_ENV=test mix test
- name: Create precompiled library
run: |
export ELIXIR_MAKE_CACHE_DIR=$(pwd)/cache
mkdir -p "${ELIXIR_MAKE_CACHE_DIR}"
mix elixir_make.precompile
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
cache/*.tar.gz
macos:
runs-on: ${{matrix.runner}}
# Homebrew supports versioned Erlang/OTP but not Elixir
# It's a deliberate design decision from Homebrew to
# only support versioned distrinutions for certin packages
name: Mac (${{ matrix.runner == 'macos-latest' && 'Intel' || 'ARM' }}) Erlang/OTP ${{matrix.otp}} / Elixir
env:
MIX_ENV: "prod"
strategy:
matrix:
runner: ["macos-latest", "self-hosted"]
otp: ["25.0", "26.0"]
elixir: ["1.14.5"]
steps:
- uses: actions/checkout@v3
- uses: asdf-vm/actions/install@v2
with:
tool_versions: |
erlang ${{matrix.otp}}
elixir ${{matrix.elixir}}
- name: Install libomp
run: |
brew install libomp
mix local.hex --force
mix local.rebar --force
- name: Mix Test
run: |
mix deps.get
MIX_ENV=test mix test
- name: Create precompiled library
run: |
export ELIXIR_MAKE_CACHE_DIR=$(pwd)/cache
mkdir -p "${ELIXIR_MAKE_CACHE_DIR}"
mix elixir_make.precompile
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ matrix.runner == 'macos-latest' && 'cache/*x86_64*.tar.gz' || 'cache/*aarch64*.tar.gz' }}
- name: Cleanup # We need this since self-hosted runners are not ephemeral
run: |
make clean