-
Notifications
You must be signed in to change notification settings - Fork 11
166 lines (142 loc) · 5.27 KB
/
emlx.yml
File metadata and controls
166 lines (142 loc) · 5.27 KB
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Test
on:
push:
branches:
- main
paths-ignore:
- '*.md'
- '**/*.md'
pull_request:
paths-ignore:
- '*.md'
- '**/*.md'
jobs:
linux:
name: ${{ matrix.job.arch }}-linux-gnu (${{ matrix.job.elixir }}, ${{ matrix.job.otp }})
runs-on: ${{ matrix.job.runs-os }}
strategy:
fail-fast: false
matrix:
job:
- { arch: "x86_64", runs-os: ubuntu-latest, otp: "25.3.2.15", elixir: "1.17.0" }
- { arch: "aarch64", runs-os: ubuntu-24.04-arm, otp: "25.3.2.15", elixir: "1.17.0" }
env:
MIX_ENV: test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Elixir and Erlang
id: setup
run: |
curl -fsSO https://elixir-lang.org/install.sh
sh install.sh elixir@${{ matrix.job.elixir }} otp@${{ matrix.job.otp }}
OTP_VERSION="${{ matrix.job.otp }}"
OTP_MAJOR="${OTP_VERSION%%.*}"
export OTP_PATH=$HOME/.elixir-install/installs/otp/${OTP_VERSION}/bin
export ELIXIR_PATH=$HOME/.elixir-install/installs/elixir/${{ matrix.job.elixir }}-otp-${OTP_MAJOR}/bin
echo "path=${OTP_PATH}:${ELIXIR_PATH}" >> $GITHUB_OUTPUT
echo "${OTP_PATH}" >> $GITHUB_PATH
echo "${ELIXIR_PATH}" >> $GITHUB_PATH
- name: Install system dependencies
run: sudo apt-get install -y libopenblas0
- name: Compile and check warnings
working-directory: emlx
run: |
export PATH="${{ steps.setup.outputs.path }}:${PATH}"
mix local.hex --force
mix local.rebar --force
mix deps.get
mix compile --warnings-as-errors
- name: Run epmd for distributed tests
run: |
export PATH="${{ steps.setup.outputs.path }}:${PATH}"
epmd -daemon
- name: Run tests
working-directory: emlx
run: |
export PATH="${{ steps.setup.outputs.path }}:${PATH}"
if [ "${{ matrix.job.build }}" = "true" ]; then
export LIBMLX_BUILD=true
fi
mix test --warnings-as-errors
macos:
name: macOS (${{ matrix.job.elixir }}, ${{ matrix.job.otp }})
runs-on: macos-26
strategy:
fail-fast: false
matrix:
job:
- { otp: "25.3.2.15", elixir: "1.17.0", lint: true }
- { otp: "25.3.2.15", elixir: "1.17.0", build: true }
- { otp: "25.3.2.15", elixir: "1.17.0", gpu: true }
- { otp: "25.3.2.15", elixir: "1.17.0", gpu: true, build: true }
env:
MIX_ENV: test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Elixir and Erlang
id: setup
run: |
curl -fsSO https://elixir-lang.org/install.sh
sh install.sh elixir@${{ matrix.job.elixir }} otp@${{ matrix.job.otp }}
OTP_VERSION="${{ matrix.job.otp }}"
OTP_MAJOR="${OTP_VERSION%%.*}"
export OTP_PATH=$HOME/.elixir-install/installs/otp/${OTP_VERSION}/bin
export ELIXIR_PATH=$HOME/.elixir-install/installs/elixir/${{ matrix.job.elixir }}-otp-${OTP_MAJOR}/bin
echo "path=${OTP_PATH}:${ELIXIR_PATH}" >> $GITHUB_OUTPUT
echo "${OTP_PATH}" >> $GITHUB_PATH
echo "${ELIXIR_PATH}" >> $GITHUB_PATH
- name: Setup Mix
working-directory: emlx
run: |
mix local.hex --force
mix local.rebar --force
- name: Retrieve dependencies cache
env:
cache-name: cache-mix-deps
uses: actions/cache@v4
id: mix-cache # id to use in retrieve action
with:
path: ${{ github.workspace }}/emlx/deps
key: ${{ runner.os }}-Elixir-v${{ matrix.job.elixir }}-OTP-${{ matrix.job.otp }}-${{ hashFiles(format('{0}/emlx/mix.lock', github.workspace)) }}-v1
- name: Install dependencies
if: ${{ steps.mix-cache.outputs.cache-hit != 'true' }}
working-directory: emlx
run: |
export PATH="${{ steps.setup.outputs.path }}:${PATH}"
mix deps.get
- name: Compile and check warnings
working-directory: emlx
run: |
export PATH="${{ steps.setup.outputs.path }}:${PATH}"
if [ "${{ matrix.job.build }}" = "true" ]; then
export LIBMLX_BUILD=true
fi
mix compile --warnings-as-errors
- name: Check formatting
if: ${{ matrix.job.lint }}
working-directory: emlx
run: |
export PATH="${{ steps.setup.outputs.path }}:${PATH}"
if [ "${{ matrix.job.build }}" = "true" ]; then
export LIBMLX_BUILD=true
fi
mix format --check-formatted
- name: Run epmd for distributed tests
run: |
export PATH="${{ steps.setup.outputs.path }}:${PATH}"
epmd -daemon
- name: Run tests
working-directory: emlx
run: |
export PATH="${{ steps.setup.outputs.path }}:${PATH}"
export EMLX_TEST_DEFAULT_GPU="${{ matrix.job.gpu }}"
if [ "${{ matrix.job.build }}" = "true" ]; then
export LIBMLX_BUILD=true
fi
if [ "${{ matrix.job.gpu }}" = "true" ]; then
find test -name "*_test.exs" -exec bash -c 'NAME={}; echo -e "\n\n----$NAME----\n"; mix test $NAME' \;
else
mix test --warnings-as-errors
fi