Skip to content

Commit 32e2075

Browse files
author
am-aurora
committed
Add loci-analysis workflow from overlay
1 parent f957fa3 commit 32e2075

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: LOCI Analysis
2+
on:
3+
push:
4+
branches:
5+
- loci/main-*
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
9+
jobs:
10+
loci:
11+
if: vars.UPSTREAM_REPO != ''
12+
runs-on: ubuntu-latest
13+
14+
env:
15+
LOCI_PROJECT: 'stable-diffusion.cpp'
16+
LOCI_API_KEY: '${{ secrets.LOCI_API_KEY }}'
17+
LOCI_BACKEND_URL: '${{ vars.LOCI_BACKEND_URL }}'
18+
GH_TOKEN: ${{ secrets.MIRROR_REPOS_WRITE_PAT }}
19+
20+
environment: ${{ vars.LOCI_ENV || 'stable-diffusion-cpp-prod' }}
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
submodules: recursive
28+
ref: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha }}
29+
30+
- name: Compute target
31+
id: target
32+
if: github.event_name == 'push'
33+
run: |
34+
branch="${{ github.ref_name }}"
35+
sha="${branch#loci/main-}"
36+
echo "value=main@${sha}" >> "$GITHUB_OUTPUT"
37+
38+
- name: Compute base
39+
id: base
40+
if: github.event_name == 'pull_request'
41+
run: |
42+
git remote add upstream "https://github.com/${{ vars.UPSTREAM_REPO }}.git" 2>/dev/null || true
43+
git fetch upstream
44+
upstream_default=$(gh api "repos/${{ vars.UPSTREAM_REPO }}" --jq .default_branch)
45+
merge_base=$(git merge-base HEAD "upstream/${upstream_default}")
46+
short_sha="${merge_base:0:7}"
47+
echo "value=main@${short_sha}" >> "$GITHUB_OUTPUT"
48+
49+
- name: Install dependencies (including curl)
50+
run: |
51+
sudo apt-get update
52+
sudo apt-get install -y \
53+
cmake \
54+
build-essential \
55+
gcc-aarch64-linux-gnu \
56+
g++-aarch64-linux-gnu \
57+
libcurl4-openssl-dev
58+
59+
- name: Create build directory and configure with CMake
60+
run: |
61+
mkdir build
62+
cd build
63+
cmake .. \
64+
-DCMAKE_SYSTEM_NAME=Linux \
65+
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \
66+
-DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
67+
-DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
68+
-DCMAKE_BUILD_TYPE=Debug \
69+
-DCMAKE_CXX_FLAGS_DEBUG="-g -gdwarf-4 -O0 -fno-omit-frame-pointer" \
70+
-DCMAKE_C_FLAGS_DEBUG="-g -gdwarf-4 -O0 -fno-omit-frame-pointer" \
71+
-DCMAKE_C_FLAGS="-march=armv8-a -Wl,-Bsymbolic" \
72+
-DCMAKE_CXX_FLAGS="-march=armv8-a -Wl,-Bsymbolic"
73+
74+
75+
- name: Build project
76+
run: |
77+
cd build
78+
cmake --build . -j4
79+
80+
- name: Upload build artifacts
81+
uses: auroralabs-loci/loci-action@v1
82+
with:
83+
mode: upload
84+
binaries: |
85+
build/bin/sd-cli
86+
build/bin/sd-server
87+
project: ${{ env.LOCI_PROJECT }}
88+
target: ${{ steps.target.outputs.value || ''}}
89+
base: ${{ steps.base.outputs.value || '' }}

0 commit comments

Comments
 (0)