-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (71 loc) · 2.07 KB
/
precompiled_nif.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
name: precompile
on:
push:
branches:
- pv-feat/precompile-artifacts
tags:
- "v*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
precompile_nif:
runs-on: ${{ matrix.os }}
env:
MIX_ENV: prod
NX_IREE_PREFER_PRECOMPILED: false
NX_IREE_SOURCE_DIR: ./build-cache/iree
IREE_GIT_REV: candidate-20240604.914
OTP_VERSION: "26.0"
strategy:
fail-fast: false
matrix:
NIF_VERSION: ["2.16", "2.17"]
os: ["macos-12", "macos-14"]
arch: ["x86_64", "aarch64"]
exclude:
- os: macos-12
arch: aarch64
- os: macos-14
arch: x86_64
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install asdf and tools
uses: asdf-vm/actions/install@v3
- name: Setup dependencies and env
run: |
brew install ninja
mix local.hex --force
mix local.rebar --force
echo "NX_IREE_SOURCE_DIR=$(elixir -e 'IO.puts(Path.absname(~s(${{env.NX_IREE_SOURCE_DIR}})))')" > $GITHUB_ENV
- name: Cache mix dependencies
id: cache-mix-deps
uses: actions/cache@v4
with:
key: deps-${{ hashFiles('mix.lock') }}
path: |
./deps
- name: Get mix deps
if: steps.cache-mix-deps.outputs.cache-hit != 'true'
run: mix deps.get
- name: Cache IREE dir
id: cache-iree-dir
uses: actions/cache@v4
with:
key: iree-dir-${{ env.IREE_GIT_REV }}
path: |
${{ env.NX_IREE_SOURCE_DIR }}
- name: Clone IREE
if: steps.cache-iree-dir.outputs.cache-hit != 'true'
run: make clone_iree
- name: Compile NIF
run: |
mix compile
cp ./cache/libnx_iree.so ./libnx_iree-${{matrix.os}}-${{matrix.arch}}-nif-${{matrix.NIF_VERSION}}.so
- name: Release Artifacts
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./*.so