-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (61 loc) · 1.94 KB
/
test-samples.yaml
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
# Copyright AGNTCY Contributors (https://github.com/agntcy)
# SPDX-License-Identifier: Apache-2.0
name: test-samples
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !contains(github.ref, 'release/')}}
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
apps-changed: ${{ steps.detect-changes.outputs.changed-dirs }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Detect changes
uses: ./.github/actions/detect-changes
id: detect-changes
with:
dirs: $(find ./samples -mindepth 2 \( -name 'pyproject.toml' -o -name 'Taskfile.yml' \) | xargs -n1 dirname | sort -u)
test:
name: Test on samples
runs-on: ubuntu-latest
needs: [detect-changes]
if: ${{ needs.detect-changes.outputs.apps-changed != '[]' && needs.detect-changes.outputs.apps-changed != '' }}
strategy:
fail-fast: false
matrix:
app: ${{ fromJson(needs.detect-changes.outputs.apps-changed) }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Environment
uses: ./.github/actions/setup-env
with:
python: true
python-version: "3.12.9"
go: false
- name: Setup K8S Tools
uses: ./.github/actions/setup-k8s
with:
kind-version: "0.25.0"
- name: Run tests
env:
AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }}
AZURE_MODEL_VERSION: ${{ vars.AZURE_MODEL_VERSION }}
AZURE_DEPLOYMENT_NAME: ${{ vars.AZURE_DEPLOYMENT_NAME }}
AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }}
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
run: |
cd ${{ matrix.app }}
task run:test
shell: bash