Skip to content

Commit 4401d3a

Browse files
feat(cicd): cron job structured target autotest every 12hours
1 parent d5446df commit 4401d3a

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Deployment Autotests
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- cicd
8+
schedule:
9+
- cron: "0 */12 * * *"
10+
11+
jobs:
12+
deployment-tests:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: "3.10"
22+
23+
- name: Install Docker
24+
uses: docker/setup-buildx-action@v2
25+
26+
- name: Install uv
27+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
28+
29+
- name: Add uv to PATH
30+
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
31+
32+
- name: Build and install SDK
33+
run: |
34+
uv venv
35+
source .venv/bin/activate
36+
uv pip install -U pytest
37+
uv pip install -e .
38+
python -m preswald.build frontend
39+
uv build
40+
pip install ./dist/*.whl
41+
42+
- name: Create .env file
43+
run: |
44+
mkdir -p autotest/deployments/structured
45+
echo "GITHUB_USERNAME=${{ secrets.DEPLOYMENT_AUTOTEST_GITHUB_USERNAME }}" > autotest/deployments/structured/.env.structured
46+
echo "STRUCTURED_CLOUD_API_KEY=${{ secrets.DEPLOYMENT_AUTOTEST_STRUCTURED_CLOUD_API_KEY }}" >> autotest/deployments/structured/.env.structured
47+
48+
- name: Run deployment tests
49+
run: |
50+
source .venv/bin/activate
51+
chmod +x autotest/deployments/structured/test.sh
52+
./autotest/deployments/structured/test.sh
53+
54+
- name: Check test results
55+
run: |
56+
if [ $? -eq 0 ]; then
57+
echo "Deployment tests passed successfully!"
58+
exit 0
59+
else
60+
echo "Deployment tests failed!"
61+
exit 1
62+
fi

0 commit comments

Comments
 (0)