Skip to content

Commit 5c6066c

Browse files
authored
Merge pull request #2178 from menloresearch/dev
chore: sync dev to main
2 parents e79abcb + ae43c53 commit 5c6066c

File tree

158 files changed

+7103
-4118
lines changed

Some content is hidden

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

158 files changed

+7103
-4118
lines changed

.github/workflows/cortex-cpp-quality-gate.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,24 @@ jobs:
137137
138138
139139
- name: Run setup config
140+
if: runner.os != 'Linux'
140141
run: |
141142
cd engine
142143
echo "huggingFaceToken: ${{ secrets.HUGGINGFACE_TOKEN_READ }}" > ~/.cortexrc
143144
echo "gitHubToken: ${{ secrets.PAT_SERVICE_ACCOUNT }}" >> ~/.cortexrc
144145
# ./build/cortex
145146
cat ~/.cortexrc
146147
148+
- name: Run setup config
149+
if: runner.os == 'Linux'
150+
run: |
151+
cd engine
152+
mkdir -p ~/.config/cortexcpp/
153+
echo "huggingFaceToken: ${{ secrets.HUGGINGFACE_TOKEN_READ }}" > ~/.config/cortexcpp/.cortexrc
154+
echo "gitHubToken: ${{ secrets.PAT_SERVICE_ACCOUNT }}" >> ~/.config/cortexcpp/.cortexrc
155+
# ./build/cortex
156+
cat ~/.config/cortexcpp/.cortexrc
157+
147158
- name: Run unit tests
148159
run: |
149160
cd engine
@@ -152,13 +163,25 @@ jobs:
152163
GITHUB_TOKEN: ${{ secrets.PAT_SERVICE_ACCOUNT }}
153164

154165
- name: Run setup config
166+
if: runner.os != 'Linux'
155167
run: |
156168
cd engine
157169
echo "apiServerPort: 3928" > ~/.cortexrc
158170
echo "huggingFaceToken: ${{ secrets.HUGGINGFACE_TOKEN_READ }}" >> ~/.cortexrc
159171
echo "gitHubToken: ${{ secrets.PAT_SERVICE_ACCOUNT }}" >> ~/.cortexrc
160172
# ./build/cortex
161173
cat ~/.cortexrc
174+
175+
- name: Run setup config
176+
if: runner.os == 'Linux'
177+
run: |
178+
cd engine
179+
mkdir -p ~/.config/cortexcpp/
180+
echo "apiServerPort: 3928" > ~/.config/cortexcpp/.cortexrc
181+
echo "huggingFaceToken: ${{ secrets.HUGGINGFACE_TOKEN_READ }}" >> ~/.config/cortexcpp/.cortexrc
182+
echo "gitHubToken: ${{ secrets.PAT_SERVICE_ACCOUNT }}" >> ~/.config/cortexcpp/.cortexrc
183+
# ./build/cortex
184+
cat ~/.config/cortexcpp/.cortexrc
162185
163186
- name: Run e2e tests
164187
if: github.event_name != 'schedule' && runner.os != 'Windows' && github.event.pull_request.draft == false
@@ -226,6 +249,13 @@ jobs:
226249
cd engine
227250
make package
228251
252+
- name: Upload E2E Log
253+
if: failure()
254+
uses: actions/upload-artifact@v4
255+
with:
256+
name: e2e-log-${{ matrix.os }}-${{ matrix.name }}
257+
path: ./engine/e2e-test/logs
258+
229259
- name: Upload Artifact
230260
uses: actions/upload-artifact@v4
231261
with:
@@ -414,12 +444,22 @@ jobs:
414444
make build CMAKE_EXTRA_FLAGS="${{ matrix.cmake-flags }}" BUILD_DEPS_CMAKE_EXTRA_FLAGS="${{ matrix.build-deps-cmake-flags }}"
415445
416446
- name: Run setup config
447+
if: runner.os != 'Linux'
417448
run: |
418449
cd engine
419450
echo "gitHubToken: ${{ secrets.GITHUB_TOKEN }}" > ~/.cortexrc
420451
# ./build/cortex
421452
cat ~/.cortexrc
422453
454+
- name: Run setup config
455+
if: runner.os == 'Linux'
456+
run: |
457+
cd engine
458+
mkdir -p ~/.config/cortexcpp/
459+
echo "gitHubToken: ${{ secrets.GITHUB_TOKEN }}" > ~/.config/cortexcpp/.cortexrc
460+
# ./build/cortex
461+
cat ~/.config/cortexcpp/.cortexrc
462+
423463
- name: Run unit tests
424464
run: |
425465
cd engine
@@ -428,12 +468,23 @@ jobs:
428468
GITHUB_TOKEN: ${{ secrets.PAT_SERVICE_ACCOUNT }}
429469

430470
- name: Run setup config
471+
if: runner.os != 'Linux'
431472
run: |
432473
cd engine
433474
echo "apiServerPort: 3928" > ~/.cortexrc
434475
echo "gitHubToken: ${{ secrets.GITHUB_TOKEN }}" > ~/.cortexrc
435476
# ./build/cortex
436477
cat ~/.cortexrc
478+
479+
- name: Run setup config
480+
if: runner.os == 'Linux'
481+
run: |
482+
cd engine
483+
mkdir -p ~/.config/cortexcpp/
484+
echo "apiServerPort: 3928" > ~/.config/cortexcpp/.cortexrc
485+
echo "gitHubToken: ${{ secrets.GITHUB_TOKEN }}" > ~/.config/cortexcpp/.cortexrc
486+
# ./build/cortex
487+
cat ~/.config/cortexcpp/.cortexrc
437488
438489
- name: Run e2e tests
439490
if: github.event_name != 'schedule' && runner.os != 'Windows' && github.event.pull_request.draft == false
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Deploy Docs on new release
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
- edited
8+
- released
9+
10+
jobs:
11+
deploy:
12+
name: Deploy to CloudFlare Pages
13+
env:
14+
CLOUDFLARE_PROJECT_NAME: cortex-docs
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
deployments: write
19+
pull-requests: write
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
ref: dev
24+
- uses: actions/setup-node@v3
25+
with:
26+
node-version: 18
27+
28+
- name: Install jq
29+
uses: dcarbone/[email protected]
30+
31+
- name: Fill env vars
32+
working-directory: docs
33+
continue-on-error: true
34+
run: |
35+
env_example_file=".env.example"
36+
touch .env
37+
while IFS= read -r line || [[ -n "$line" ]]; do
38+
if [[ "$line" == *"="* ]]; then
39+
var_name=$(echo $line | cut -d '=' -f 1)
40+
echo $var_name
41+
var_value="$(jq -r --arg key "$var_name" '.[$key]' <<< "$SECRETS")"
42+
echo "$var_name=$var_value" >> .env
43+
fi
44+
done < "$env_example_file"
45+
env:
46+
SECRETS: '${{ toJson(secrets) }}'
47+
48+
- name: Install dependencies
49+
working-directory: docs
50+
run: yarn install
51+
- name: Build website
52+
working-directory: docs
53+
run: export NODE_ENV=production && yarn build
54+
55+
- name: Copy redirect file
56+
working-directory: docs
57+
continue-on-error: true
58+
run: cp _redirects build/_redirects
59+
60+
- name: Publish to Cloudflare Pages Production
61+
uses: cloudflare/pages-action@v1
62+
with:
63+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
64+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
65+
projectName: ${{ env.CLOUDFLARE_PROJECT_NAME }}
66+
directory: ./docs/build
67+
branch: main
68+
# Optional: Enable this if you want to have GitHub Deployments triggered
69+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-cortexso-model-hub.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
run: |
6868
cd engine
6969
./build/cortex --version
70-
sed -i 's/huggingFaceToken: ""/huggingFaceToken: "${{ secrets.HUGGINGFACE_TOKEN_READ }}"/' ~/.cortexrc
70+
sed -i 's/huggingFaceToken: ""/huggingFaceToken: "${{ secrets.HUGGINGFACE_TOKEN_READ }}"/' ~/.config/cortexcpp/.cortexrc
7171
7272
- name: Run e2e tests
7373
run: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ build
1717
platform/cortex.exe
1818
platform/package-lock.json
1919
.vscode
20+
.vs
2021
platform/command
2122
platform/src/infrastructure/commanders/test/test_data
2223
**/vcpkg_installed

BUILDING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ cd vcpkg
3333
```bash
3434
mkdir build
3535
cd build
36-
cmake .. -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static
37-
cmake --build . --config Release
36+
cmake .. -DBUILD_SHARED_LIBS=OFF "-DCMAKE_TOOLCHAIN_FILE=..\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static
37+
cmake --build . --config Release -j4
3838
```
3939

4040
4. Verify that Cortex.cpp is installed correctly by getting help information.

0 commit comments

Comments
 (0)