-
Notifications
You must be signed in to change notification settings - Fork 8
139 lines (133 loc) · 4.83 KB
/
elixir.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
name: Elixir CI
on:
pull_request:
paths-ignore:
- "*.md"
- "**/*.md"
- "LICENSE*"
workflow_dispatch:
inputs:
mlir_wheel_version:
description: "mlir wheel version to install"
required: false
workflow_call:
inputs:
mlir_wheel_version:
description: "mlir wheel version to install"
type: string
required: false
permissions:
contents: read
concurrency:
group: build-and-test-${{ github.ref }}-${{ inputs.mlir_wheel_version }}
cancel-in-progress: true
jobs:
build:
name: otp${{matrix.otp}}-ex${{matrix.elixir}} / ${{matrix.runs-on}}
runs-on: ${{matrix.runs-on}}
strategy:
fail-fast: false
matrix:
runs-on: ["ubuntu-22.04"]
otp: ["24.2", "25.0"]
elixir: ["1.14.0", "1.16.2", "1.17.2", "1.18.0"]
exclude:
- otp: "24.2"
elixir: "1.17.2"
- otp: "24.2"
elixir: "1.18.0"
include:
- runs-on: "ubuntu-22.04"
otp: "27.0.1"
elixir: "1.17.2"
steps:
- uses: actions/checkout@v3
name: Check-out beaver
- uses: actions/checkout@v3
name: Check-out kinda
with:
repository: beaver-lodge/kinda
path: kinda
- run: mv kinda ..
- uses: actions/checkout@v3
name: Check-out Kinda
if: contains(github.event.pull_request.labels.*.name, 'checkout_kinda')
with:
repository: beaver-lodge/kinda
path: kinda_local
ref: remove-meta
- run: echo "BEAVER_KINDA_PATH=${PWD}/kinda_local" >> $GITHUB_ENV
if: contains(github.event.pull_request.labels.*.name, 'checkout_kinda')
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Set up Zig
uses: mlugg/setup-zig@v1
with:
version: 0.13.0
- uses: Jimver/cuda-toolkit@master
id: cuda-toolkit
with:
use-github-cache: false
log-file-suffix: '${{matrix.runs-on}}-otp${{matrix.otp}}-ex${{matrix.elixir}}.txt'
sub-packages: '["nvcc"]'
method: network
- name: Check formatting of Zig
run: |
zig fmt --check native/src native/build.zig
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Install MLIR (specified version), via ${{ github.event_name }}
if: github.event_name == 'workflow_dispatch' && inputs.mlir_wheel_version != 'latest'
run: |
python3 -m pip install mlir=="${{ inputs.mlir_wheel_version }}" -f https://makslevental.github.io/wheels -U
echo "LLVM_CONFIG_PATH=$(python3 -c 'import mlir;print(mlir.__path__[0])')/bin/llvm-config" >> "$GITHUB_ENV"
- name: Install MLIR (latest), via ${{ github.event_name }}
if: inputs.mlir_wheel_version == 'latest' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'use-latest-mlir'))
run: |
latest_version=$(curl -Ls https://makslevental.github.io/wheels | grep -oh '[0-9.]*+cuda.[a-z0-9]*' | sort | tail -n 1)
python3 -m pip install "mlir==${latest_version}" -f https://makslevental.github.io/wheels -U
echo "LLVM_CONFIG_PATH=$(python3 -c 'import mlir;print(mlir.__path__[0])')/bin/llvm-config" >> "$GITHUB_ENV"
- name: Install MLIR (fixed version), via ${{ github.event_name }}
if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'use-latest-mlir')
run: |
python3 -m pip install -r dev-requirements.txt
echo "LLVM_CONFIG_PATH=$(python3 -c 'import mlir;print(mlir.__path__[0])')/bin/llvm-config" >> "$GITHUB_ENV"
- name: Build native library
env:
MIX_ENV: test
run: |
mix compile.elixir_make
- name: Run smoke tests
run: |
mix test --force --only smoke
- name: Check formatting of Elixir
if: matrix.elixir != '1.14.0'
env:
MIX_ENV: test
run: |
mix format --check-formatted
- name: Run tests
run: |
mix test --exclude vulkan --exclude todo
- name: Run dev build
run: |
mix
mix credo
mix elixir_make.checksum --only-local --ignore-unavailable --print
mix hex.build
- name: Run overhead profiling
if: matrix.otp == '27.0.1'
run: |
mix profile.tprof --no-compile profile/enif_add_overhead.exs