-
Notifications
You must be signed in to change notification settings - Fork 2
142 lines (122 loc) · 3.85 KB
/
ci.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: release-artifacts
on:
# push:
# tags:
# - "v*"
push:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
MIX_ENV: prod
NX_IREE_PREFER_PRECOMPILED: "false"
BUILD_CACHE: ${{ github.workspace }}/build_cache
IREE_DIR: ${{ github.workspace }}/build_cache/iree
jobs:
download_iree:
runs-on: macos-14
strategy:
matrix:
OTP_VERSION: ["27.0"]
ELIXIR_VERSION: ["1.15.4"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install asdf
uses: asdf-vm/actions/setup@v3
- name: Install Erlang and Elixir
run: |
asdf plugin add erlang
asdf plugin add elixir
asdf install erlang ${{ matrix.OTP_VERSION }}
asdf install elixir ${{ matrix.ELIXIR_VERSION }}
asdf global erlang ${{ matrix.OTP_VERSION }}
asdf global elixir ${{ matrix.ELIXIR_VERSION }}
mix local.hex --force
mix local.rebar --force
- name: Cache mix packages
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: Get IREE version
id: get-iree-version
run: echo "iree_version=$(mix iree.version)" >> $GITHUB_ENV
- name: Cache IREE source code
id: cache-iree
uses: actions/cache@v4
with:
key: iree-${{ env.iree_version }}
path: |
${{ env.IREE_DIR }}
- name: Download IREE source code
if: steps.cache-iree.outputs.cache-hit != 'true'
run: |
./scripts/clone_iree.sh ${{ env.BUILD_CACHE }} ${{ env.iree_version }} ${{ env.IREE_DIR }}
build_artifacts:
name: "Build artifacts (${{matrix.build_target}} / Elixir ${{ matrix.ELIXIR_VERSION }} / OTP ${{ matrix.OTP_VERSION }})"
runs-on: macos-14
strategy:
matrix:
OTP_VERSION: ["27.0"]
ELIXIR_VERSION: ["1.15.4"]
build_target:
- "cpu"
# - "ios"
# - "ios_simulator"
# - "visionos"
# - "visionos_simulator"
# - "watchos"
# - "watchos_simulator"
# - "tvos"
# - "tvos_simulator"
needs: download_iree
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install asdf
uses: asdf-vm/actions/setup@v3
- name: Setup XCode
run: |
xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
xcodebuild -version -sdk
- name: Install Erlang and Elixir
run: |
asdf plugin add erlang
asdf plugin add elixir
asdf install erlang ${{ matrix.OTP_VERSION }}
asdf install elixir ${{ matrix.ELIXIR_VERSION }}
asdf global erlang ${{ matrix.OTP_VERSION }}
asdf global elixir ${{ matrix.ELIXIR_VERSION }}
mix local.hex --force
mix local.rebar --force
- name: Install build dependencies
run: |
brew install cmake ninja
- name: Cache mix packages
id: cache-mix-deps
uses: actions/cache/restore@v4
with:
key: deps-${{ hashFiles('mix.lock') }}
path: |
./deps
- name: Get IREE version
id: get-iree-version
run: echo "iree_version=$(mix iree.version)" >> $GITHUB_ENV
- name: Restore IREE source code
id: cache-iree
uses: actions/cache/restore@v4
with:
key: iree-${{ env.iree_version }}
path: |
${{ env.IREE_DIR }}
- name: Build IREE
run: |
make compile IREE_DIR=${{ env.IREE_DIR }} IREE_BUILD_TARGET=${{ matrix.build_target }}
ls ${{ env.IREE_DIR }}/install