Skip to content

Commit 4bd62c6

Browse files
core: add ancient ci, trunk-check and a test ci
1 parent 0218d06 commit 4bd62c6

File tree

3 files changed

+181
-0
lines changed

3 files changed

+181
-0
lines changed

.github/workflows/ci.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [cairo-chatbot, main]
6+
pull_request:
7+
branches: [cairo-chatbot, main]
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
13+
jobs:
14+
build:
15+
name: Build
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
27+
- name: Setup pnpm
28+
uses: pnpm/action-setup@v3
29+
with:
30+
version: 9.10.0
31+
32+
- name: Get pnpm store directory
33+
id: pnpm-cache
34+
shell: bash
35+
run: |
36+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
37+
38+
- name: Setup pnpm cache
39+
uses: actions/cache@v4
40+
with:
41+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
42+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
43+
restore-keys: |
44+
${{ runner.os }}-pnpm-store-
45+
46+
- name: Install dependencies
47+
run: pnpm install
48+
49+
- name: Install turbo
50+
run: pnpm add turbo@latest -g
51+
- name: Build
52+
run: turbo build
53+
54+
test:
55+
name: Test
56+
runs-on: ubuntu-latest
57+
needs: build
58+
59+
steps:
60+
- name: Checkout repository
61+
uses: actions/checkout@v4
62+
63+
- name: Setup Node.js
64+
uses: actions/setup-node@v4
65+
with:
66+
node-version: 20
67+
68+
- name: Setup pnpm
69+
uses: pnpm/action-setup@v3
70+
with:
71+
version: 9.10.0
72+
73+
- name: Get pnpm store directory
74+
id: pnpm-cache
75+
shell: bash
76+
run: |
77+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
78+
79+
- name: Setup pnpm cache
80+
uses: actions/cache@v4
81+
with:
82+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
83+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
84+
restore-keys: |
85+
${{ runner.os }}-pnpm-store-
86+
87+
- name: Install dependencies
88+
run: pnpm install
89+
90+
- name: Install turbo
91+
run: pnpm add turbo@latest -g
92+
93+
- name: Create config file
94+
run: |
95+
mkdir -p packages/agents
96+
cat > packages/agents/config.toml << 'EOL'
97+
[API_KEYS]
98+
OPENAI = "${{ secrets.OPENAI_API_KEY }}"
99+
GROQ = "${{ secrets.GROQ_API_KEY }}"
100+
ANTHROPIC = "${{ secrets.ANTHROPIC_API_KEY }}"
101+
DEEPSEEK = "${{ secrets.DEEPSEEK_API_KEY }}"
102+
GEMINI = "${{ secrets.GEMINI_API_KEY }}"
103+
104+
[API_ENDPOINTS]
105+
OLLAMA = "${{ secrets.OLLAMA_ENDPOINT }}"
106+
107+
[VECTOR_DB]
108+
MONGODB_URI = "${{ secrets.MONGODB_URI }}"
109+
DB_NAME = "${{ secrets.DB_NAME }}"
110+
COLLECTION_NAME = "${{ secrets.COLLECTION_NAME }}"
111+
112+
[GENERAL]
113+
PORT = 3001
114+
SIMILARITY_MEASURE = "cosine"
115+
116+
[HOSTED_MODE]
117+
DEFAULT_CHAT_PROVIDER = "${{ secrets.DEFAULT_CHAT_PROVIDER }}"
118+
DEFAULT_CHAT_MODEL = "${{ secrets.DEFAULT_CHAT_MODEL }}"
119+
DEFAULT_FAST_CHAT_PROVIDER = "${{ secrets.DEFAULT_FAST_CHAT_PROVIDER }}"
120+
DEFAULT_FAST_CHAT_MODEL = "${{ secrets.DEFAULT_FAST_CHAT_MODEL }}"
121+
DEFAULT_EMBEDDING_PROVIDER = "${{ secrets.DEFAULT_EMBEDDING_PROVIDER }}"
122+
DEFAULT_EMBEDDING_MODEL = "${{ secrets.DEFAULT_EMBEDDING_MODEL }}"
123+
124+
[VERSIONS]
125+
STARKNET_FOUNDRY = "${{ secrets.STARKNET_FOUNDRY_VERSION }}"
126+
SCARB = "${{ secrets.SCARB_VERSION }}"
127+
EOL
128+
129+
- name: Run tests
130+
run: turbo test

.github/workflows/test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
11+
permissions:
12+
pull-requests: write
13+
14+
15+
jobs:
16+
my-job:
17+
name: My Job
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Print a greeting
21+
env:
22+
MY_VAR: Hi there! My name is
23+
FIRST_NAME: Mona
24+
MIDDLE_NAME: The
25+
LAST_NAME: Octocat
26+
run: |
27+
echo $MY_VAR $FIRST_NAME $MIDDLE_NAME $LAST_NAME.
28+
29+

.github/workflows/trunk-check.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Pull Request
2+
on: [pull_request]
3+
concurrency:
4+
group: ${{ github.head_ref || github.run_id }}
5+
cancel-in-progress: true
6+
7+
permissions: read-all
8+
9+
jobs:
10+
trunk_check:
11+
name: Trunk Code Quality Runner
12+
runs-on: ubuntu-latest
13+
permissions:
14+
checks: write # For trunk to post annotations
15+
contents: read # For repo checkout
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
21+
- name: Trunk Code Quality
22+
uses: trunk-io/trunk-action@v1

0 commit comments

Comments
 (0)