-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee6800d
commit a843962
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,3 +78,69 @@ jobs: | |
with: | ||
files: | | ||
./*.tar.gz | ||
precompile_nif_linux_x86_64: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
MIX_ENV: prod | ||
NX_IREE_PREFER_PRECOMPILED: false | ||
NX_IREE_SOURCE_DIR: ./build-cache/iree | ||
IREE_GIT_REV: candidate-20240604.914 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
nif_version: [2.16, 2.17] | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install asdf and tools | ||
uses: asdf-vm/actions/install@v3 | ||
|
||
- name: cuda-toolkit | ||
uses: Jimver/[email protected] | ||
|
||
- name: Setup Ninja | ||
uses: ashutoshvarma/setup-ninja@master | ||
with: | ||
version: 1.10.0 | ||
|
||
- name: Setup dependencies and env | ||
run: | | ||
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 | ||
echo "PKG_NAME=libnx_iree-linux-x86_64-nif-${{matrix.nif_version}}" >> $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 | ||
mkdir ${{ env.PKG_NAME }} | ||
cp ./cache/libnx_iree.so ./${{ env.PKG_NAME }}/libnx_iree.so | ||
cp -r ./cache/iree-runtime ./${{ env.PKG_NAME }}/iree-runtime | ||
tar -czf ${{ env.PKG_NAME }}.tar.gz ${{ env.PKG_NAME }} | ||
- name: Release Artifacts | ||
uses: softprops/action-gh-release@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
./*.tar.gz |