This repository was archived by the owner on Apr 2, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 9
154 lines (145 loc) · 5.75 KB
/
Copy pathtests.yml
File metadata and controls
154 lines (145 loc) · 5.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: Run Tests
on:
workflow_call:
inputs:
notebook:
type: string
required: true
description: file to run (ending in .ipynb), can be directory to batch run (without trailing slash)
features:
type: string
required: false
description: 'Features to enable'
default: ''
front-end-image:
type: string
description: 'Front end image to run'
default: 'ghcr.io/agixt/interactive:main'
required: true
front-end-port:
type: string
default: '3437'
port-mapping:
type: string
additional-python-dependencies:
type: string
description: add whatever pip you need here
default: 'pyotp requests qrcode==7.4.2 opencv-python-headless numpy pyzbar openai agixtsdk xts gtts tqdm soundfile playwright playwright_stealth && playwright install-deps && playwright install'
report-name:
type: string
default: 'test-reports'
description: 'Name of the report'
wait-time:
type: string
description: 'Time to wait for services to be ready'
default: '30'
secrets:
api-key:
description: Optional api-key available as os.getenv('API_KEY') in your notebook
DISCORD_WEBHOOK:
description: Optional discord webhook available as os.getenv('DISCORD_WEBHOOK') in your notebook
EZLOCALAI_URI:
description: Optional ezlocalai uri available as os.getenv('EZLOCALAI_URI') in your notebook
EZLOCALAI_API_KEY:
description: Optional ezlocalai api key available as os.getenv('EZLOCALAI_API_KEY') in your notebook
GOOGLE_TEST_EMAIL:
description: Optional Google test email for OAuth testing
GOOGLE_TEST_PASSWORD:
description: Optional Google test password for OAuth testing
jobs:
test:
name: Tests
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
outputs:
digest: ${{ steps.dockerBuild.outputs.digest }}
services:
front-end:
image: ${{ inputs.front-end-image }}
ports:
- ${{ inputs.port-mapping || format('{0}:{1}', inputs.front-end-port, inputs.front-end-port) }}
options: >-
--health-cmd "curl -f http://localhost:${{ inputs.front-end-port }}"
--health-interval 10s
--health-timeout 15s
--health-retries 10
--health-start-period 5m
env:
mode: production
NEXT_TELEMETRY_DISABLED: 1
AGIXT_AGENT: XT
AGIXT_FOOTER_MESSAGE: 'AGiXT 2025'
APP_DESCRIPTION: 'XT is an advanced artificial intelligence agent orchestration agent.'
APP_NAME: XT
AGIXT_FILE_UPLOAD_ENABLED: true
AGIXT_VOICE_INPUT_ENABLED: true
AGIXT_RLHF: true
AGIXT_ALLOW_MESSAGE_EDITING: true
AGIXT_ALLOW_MESSAGE_DELETION: true
AGIXT_SHOW_OVERRIDE_SWITCHES: tts,websearch,analyze-user-input
INTERACTIVE_MODE: chat
ALLOW_EMAIL_SIGN_IN: true
APP_URI: http://localhost:${{ inputs.front-end-port }}
AGIXT_SERVER: https://api.agixt.dev
LOG_VERBOSITY_SERVER: 3
TZ: America/New_York
steps:
- uses: actions/setup-python@v5.3.0
with:
python-version: '3.10'
- name: Checkout
uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
- name: Install Python dependencies
run: pip3 install jupyter nbconvert[webpdf] ${{ inputs.additional-python-dependencies }}
- name: Update package lists and install jupyter output generation dependencies
run: |
sudo apt-get update
sudo apt-get install --fix-missing -y pandoc texlive-xetex texlive-fonts-recommended texlive-plain-generic curl ffmpeg
- name: Set notebook and artifact files
run: |
notebook="${{ inputs.notebook }}"
if ${{ endsWith( inputs.notebook, 'ipynb' ) }} ; then
echo "notebook-file=${notebook}" >> "$GITHUB_ENV"
echo "artifact-file=${notebook%.*}.pdf" >> "$GITHUB_ENV"
else
echo "notebook-file=${notebook}/*.ipynb" >> "$GITHUB_ENV"
echo "artifact-file=${notebook}/*.pdf" >> "$GITHUB_ENV"
fi
- name: Check front-end logs
run: docker logs ${{ job.services.front-end.id }} --follow &
- name: Execute notebook
id: execute_notebook
env:
API_KEY: ${{ secrets.api-key }}
features: ${{ inputs.features }}
EZLOCALAI_URI: ${{ secrets.EZLOCALAI_URI }}
EZLOCALAI_API_KEY: ${{ secrets.EZLOCALAI_API_KEY }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_REF_NAME: ${{ github.ref_name }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_EVENT_HEAD_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
echo "Executing notebook with strict error checking..."
# First try to execute and generate PDF
python3 -m nbconvert --execute --log-level INFO --to pdf ${{ env.notebook-file }}
STRICT_STATUS=$?
echo "strict_status=${STRICT_STATUS}" >> $GITHUB_ENV
- name: Rerun allowing errors if strict status is not 0
if: env.strict_status != '0'
run: |
echo "Executing notebook with error tolerance..."
python3 -m nbconvert --execute --allow-errors --log-level INFO --to pdf ${{ env.notebook-file }}
- uses: actions/upload-artifact@v4.4.3
if: always()
with:
name: ${{ inputs.report-name }}
path: ${{ env.artifact-file }}
- name: Exit with test status
if: env.strict_status != '0'
run: exit 1