Skip to content

Commit 8a7188c

Browse files
committed
add: CI/CD
1 parent e1ac514 commit 8a7188c

File tree

4 files changed

+193
-41
lines changed

4 files changed

+193
-41
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+5-41
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,9 @@
1-
## Purpose
2-
<!-- Describe the intention of the changes being proposed. What problem does it solve or functionality does it add? -->
3-
* ...
1+
## Summary
2+
<!-- Use GH Copilot to generate -->
43

54
## Does this introduce a breaking change?
65
<!-- Mark one with an "x". -->
76
```
8-
[ ] Yes
9-
[ ] No
10-
```
11-
12-
## Pull Request Type
13-
What kind of change does this Pull Request introduce?
14-
15-
<!-- Please check the one that applies to this PR using "x". -->
16-
```
17-
[ ] Bugfix
18-
[ ] Feature
19-
[ ] Code style update (formatting, local variables)
20-
[ ] Refactoring (no functional changes, no api changes)
21-
[ ] Documentation content changes
22-
[ ] Other... Please describe:
23-
```
24-
25-
## How to Test
26-
* Get the code
27-
28-
```
29-
git clone [repo-address]
30-
cd [repo-name]
31-
git checkout [branch-name]
32-
npm install
33-
```
34-
35-
* Test the code
36-
<!-- Add steps to run the tests suite and/or manually test -->
37-
```
38-
```
39-
40-
## What to Check
41-
Verify that the following are valid
42-
* ...
43-
44-
## Other Information
45-
<!-- Add any other helpful information that may be needed here. -->
7+
[] Yes
8+
[] No
9+
```

.github/workflows/build.yml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: '3.11'
23+
24+
- name: Extract version from tag
25+
id: extract_version
26+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install -r requirements.txt
32+
pip install wheel
33+
34+
- name: Build package
35+
run: |
36+
invoke build --version $VERSION
37+
38+
- name: Create Release
39+
id: create_release
40+
uses: actions/create-release@v1
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
with:
44+
tag_name: ${{ github.ref }}
45+
release_name: Release ${{ github.ref }}
46+
draft: false
47+
prerelease: false
48+
49+
- name: Upload Release Asset
50+
uses: actions/upload-release-asset@v1
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
with:
54+
upload_url: ${{ steps.create_release.outputs.upload_url }}
55+
asset_path: ./vanilla_aiagents/dist/vanilla_aiagents-${{ env.VERSION }}.tar.gz
56+
asset_name: vanilla_aiagents-${{ env.VERSION }}.tar.gz
57+
asset_content_type: application/gzip
58+
59+
- name: Upload Wheel Asset
60+
uses: actions/upload-release-asset@v1
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
with:
64+
upload_url: ${{ steps.create_release.outputs.upload_url }}
65+
asset_path: ./vanilla_aiagents/dist/vanilla_aiagents-${{ env.VERSION }}-py3-none-any.whl
66+
asset_name: vanilla_aiagents-${{ env.VERSION }}-py3-none-any.whl
67+
asset_content_type: application/zip

.github/workflows/docs.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: docs
2+
3+
# build the documentation whenever there are new commits on main
4+
on:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- main
9+
# Alternative: only build for tags.
10+
# tags:
11+
# - '*'
12+
13+
# security: restrict permissions for CI jobs.
14+
permissions:
15+
contents: read
16+
id-token: write
17+
18+
jobs:
19+
# Build the documentation and upload the static HTML files as an artifact.
20+
build:
21+
runs-on: ubuntu-latest
22+
env:
23+
PDOC_ALLOW_EXEC: 1
24+
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
25+
AZURE_OPENAI_MODEL: ${{ vars.AZURE_OPENAI_MODEL }}
26+
AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }}
27+
AZURE_DYNAMIC_SESSIONS_ENDPOINT: ${{ secrets.AZURE_DYNAMIC_SESSIONS_ENDPOINT }}
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: actions/setup-python@v5
31+
with:
32+
python-version: "3.13"
33+
34+
- name: Azure CLI Login
35+
uses: azure/login@v2
36+
with:
37+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
38+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
39+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
40+
41+
- run: pip install -r requirements.txt
42+
43+
- run: invoke docs
44+
45+
- uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: ./vanilla_aiagents/docs/
48+
49+
# Deploy the artifact to GitHub pages.
50+
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
51+
deploy:
52+
needs: build
53+
runs-on: ubuntu-latest
54+
permissions:
55+
pages: write
56+
id-token: write
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
steps:
61+
- id: deployment
62+
uses: actions/deploy-pages@v4

.github/workflows/pytest.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Testing
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
id-token: write
17+
18+
env:
19+
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
20+
AZURE_OPENAI_MODEL: ${{ vars.AZURE_OPENAI_MODEL }}
21+
AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }}
22+
AZURE_DYNAMIC_SESSIONS_ENDPOINT: ${{ secrets.AZURE_DYNAMIC_SESSIONS_ENDPOINT }}
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v2
27+
28+
- name: Azure CLI Login
29+
uses: azure/login@v2
30+
with:
31+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
32+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
33+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
34+
35+
- name: Set up Python
36+
uses: actions/setup-python@v2
37+
with:
38+
python-version: '3.11'
39+
40+
- name: Install dependencies
41+
run: |
42+
python -m pip install --upgrade pip
43+
pip install -r requirements.txt
44+
45+
- name: Run tests with coverage
46+
run: |
47+
invoke test
48+
49+
- name: Upload coverage report
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: coverage-report
53+
path: htmlcov/
54+
55+
- name: Upload coverage badge
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: coverage-badge
59+
path: coverage-badge.svg

0 commit comments

Comments
 (0)