Skip to content

Commit fede244

Browse files
committed
Initial monorepo import
0 parents  commit fede244

1,835 files changed

Lines changed: 396304 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @tetherto/ai-runtime-merge @tetherto/ai-runtime-bk
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
name: C++ lint check
2+
description: "Run C++ lint check"
3+
4+
inputs:
5+
secret-token:
6+
description: "Secret token"
7+
required: true
8+
pat-token:
9+
description: "PAT token"
10+
required: false
11+
ref:
12+
description: "Ref"
13+
required: false
14+
repository:
15+
description: "Repository"
16+
required: false
17+
target_sha:
18+
description: "SHA"
19+
required: false
20+
pr_head_sha:
21+
description: "PR head SHA"
22+
required: false
23+
workdir:
24+
default: "."
25+
type: string
26+
27+
runs:
28+
using: composite
29+
steps:
30+
- name: Checkout PR head and target
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
token: ${{ inputs.pat-token }}
35+
repository: ${{ inputs.repository }}
36+
ref: ${{ inputs.ref }}
37+
38+
- name: Configure git
39+
shell: bash
40+
run: git config --global --add url."https://${{ inputs.pat-token }}:x-oauth-basic@github.com/".insteadOf "git@github.com:"
41+
42+
- name: Setup Node.js
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: "18.x"
46+
47+
- name: Restore npm cache
48+
id: cache-npm
49+
uses: actions/cache@v4
50+
with:
51+
path: ~/.npm
52+
key: npm-${{ runner.os }}-${{ hashFiles('**/package.json') }}
53+
restore-keys: |
54+
npm-${{ runner.os }}-
55+
56+
- run: |
57+
# @qvac/* from npmjs.org
58+
echo "@qvac:registry=https://registry.npmjs.org/" >> .npmrc
59+
echo "//registry.npmjs.org/:_authToken=${{ inputs.secret-token }}" >> .npmrc
60+
61+
# @tetherto/* from GitHub Packages
62+
echo "@tetherto:registry=https://npm.pkg.github.com/" >> .npmrc
63+
echo "//npm.pkg.github.com/:_authToken=${{ inputs.pat-token }}" >> .npmrc
64+
65+
git config --global url."https://${{ inputs.pat-token }}:@github.com/".insteadOf "https://github.com/"
66+
shell: bash
67+
68+
- name: Install dependencies
69+
shell: bash
70+
run: npm install
71+
72+
- name: Configure vcpkg
73+
shell: bash
74+
run: |
75+
echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV
76+
export VCPKG_BINARY_SOURCES="clear;files,$GITHUB_WORKSPACE/vcpkg/cache,readwrite"
77+
78+
- name: Create vcpkg cache location
79+
shell: bash
80+
run: mkdir -p vcpkg/cache
81+
82+
- name: Get vcpkg cache
83+
uses: actions/cache@v4
84+
with:
85+
path: vcpkg/cache
86+
key: linux-x64-${{ hashFiles( 'vcpkg.json', 'vcpkg-configuration.json', 'vcpkg/ports/**' ) }}
87+
restore-keys: linux-x64-
88+
89+
- name: Install bare-make
90+
id: install_bare_make
91+
continue-on-error: true
92+
shell: bash
93+
run: |
94+
npm install -g bare-make
95+
96+
- name: Install vulkan
97+
continue-on-error: true
98+
shell: bash
99+
run: |
100+
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
101+
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
102+
sudo apt update
103+
sudo apt install vulkan-sdk
104+
105+
- name: Generate build system
106+
continue-on-error: true
107+
shell: bash
108+
run: |
109+
which bare-make|| echo "bare-make not found"
110+
bare-make --version || echo "bare-make command failed"
111+
if ! command -v bare-make >/dev/null; then
112+
echo "bare-make not installed, skipping"
113+
exit 0
114+
fi
115+
bare-make generate
116+
117+
- name: Check C++ files format
118+
continue-on-error: true
119+
shell: bash
120+
run: |
121+
TARGET_SHA=${{ inputs.target_sha }}
122+
PR_HEAD_SHA=${{ inputs.pr_head_sha }}
123+
if [ -z "$TARGET_SHA" ] || [ -z "$PR_HEAD_SHA" ]; then
124+
echo "No target or head SHA specified, skipping format check."
125+
exit 0
126+
fi
127+
128+
wget https://apt.llvm.org/llvm.sh
129+
chmod +x llvm.sh
130+
sudo ./llvm.sh 19 all
131+
132+
OUTPUT=$(git-clang-format-19 --binary clang-format-19 --diff $TARGET_SHA $PR_HEAD_SHA 2>&1)
133+
EXIT_CODE=$?
134+
if [ $EXIT_CODE -ne 0 ]; then
135+
if echo "$OUTPUT" | grep -q "no modified files to format"; then
136+
echo "No modified C++ files to format, skipping error."
137+
exit 0
138+
else
139+
echo "::error title=Unformatted C++ files::Please format your C++ files."
140+
echo "$OUTPUT"
141+
exit 1
142+
fi
143+
fi
144+
145+
- name: Build
146+
continue-on-error: true
147+
shell: bash
148+
run: |
149+
if ! command -v bare-make >/dev/null; then
150+
echo "bare-make not installed, skipping build"
151+
exit 0
152+
fi
153+
bare-make build
154+
155+
- name: Run C++ tests
156+
shell: bash
157+
continue-on-error: true
158+
run: |
159+
if ! command -v bare-make >/dev/null; then
160+
echo "bare-make not installed, skipping tests"
161+
exit 0
162+
fi
163+
bare-make test
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Detect Version Bump
2+
description: Detects a version bump by comparing package.json at a previous SHA.
3+
inputs:
4+
prev_sha:
5+
description: "Previous commit SHA for version comparison"
6+
required: false
7+
current_version:
8+
description: "Current version (required)"
9+
required: true
10+
workdir:
11+
description: "Working directory (optional)"
12+
required: false
13+
default: "."
14+
outputs:
15+
bumped:
16+
description: "true if version differs from previous SHA"
17+
value: ${{ steps.detect.outputs.bumped }}
18+
current:
19+
description: "Current version"
20+
value: ${{ steps.detect.outputs.current }}
21+
previous:
22+
description: "Previous version (from prev_sha)"
23+
value: ${{ steps.detect.outputs.previous }}
24+
runs:
25+
using: "composite"
26+
steps:
27+
- id: detect
28+
shell: bash
29+
working-directory: ${{ inputs.workdir }}
30+
run: |
31+
set -euo pipefail
32+
current_version="${{ inputs.current_version }}"
33+
if [ -z "${current_version}" ]; then
34+
echo "Missing required input: current_version"
35+
exit 1
36+
fi
37+
echo "current=${current_version}" >> "${GITHUB_OUTPUT}"
38+
39+
prev_sha="${{ inputs.prev_sha }}"
40+
if [ -z "${prev_sha}" ]; then
41+
echo "previous=" >> "${GITHUB_OUTPUT}"
42+
echo "bumped=false" >> "${GITHUB_OUTPUT}"
43+
exit 0
44+
fi
45+
46+
workdir="${{ inputs.workdir }}"
47+
if [ -z "${workdir}" ] || [ "${workdir}" = "." ]; then
48+
package_json_path="package.json"
49+
else
50+
package_json_path="${workdir%/}/package.json"
51+
fi
52+
53+
prev_version=$(git show "${prev_sha}:${package_json_path}" | node -e "const fs=require('fs');const data=fs.readFileSync(0,'utf8');console.log(JSON.parse(data).version);")
54+
echo "previous=${prev_version}" >> "${GITHUB_OUTPUT}"
55+
56+
if [ "${current_version}" = "${prev_version}" ]; then
57+
echo "bumped=false" >> "${GITHUB_OUTPUT}"
58+
else
59+
echo "bumped=true" >> "${GITHUB_OUTPUT}"
60+
fi

0 commit comments

Comments
 (0)