Skip to content

Commit b3a4750

Browse files
authored
Split taskfiles by components (#49)
* refactor: split taskfiles by components This commit contains modifications to the existing taskfiles and creates new one as well. The modifications are the followings: - Remove forced current working directory in samples apps - Mark unused tasks as internal - Fix some bugs - Create some checks The new taskfiles is for organizing all of the tasks into the repo root main taskfile, so tasks can be called from everywhere. Signed-off-by: Árpád Csepi <[email protected]> * ci: use new taskfile structure Signed-off-by: Árpád Csepi <[email protected]> * fix: change all taskfile extension to .yml Signed-off-by: Árpád Csepi <[email protected]> * ci: fix detect changes in samples Signed-off-by: Árpád Csepi <[email protected]> * fix(samples): call task without subshell Signed-off-by: Árpád Csepi <[email protected]> * ci(integrations): enable workflow run on PR and main merge Signed-off-by: Árpád Csepi <[email protected]> * ci(integrations): fix kind version on alt trigger Signed-off-by: Árpád Csepi <[email protected]> --------- Signed-off-by: Árpád Csepi <[email protected]>
1 parent 4352d2f commit b3a4750

File tree

16 files changed

+432
-351
lines changed

16 files changed

+432
-351
lines changed

.github/workflows/test-integrations.yaml

+32-29
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,38 @@
33

44
name: test-integrations
55
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request:
610
workflow_dispatch:
711
inputs:
8-
destroy-cluster:
9-
description: 'Destroy test cluster'
10-
required: false
11-
default: true
12-
type: boolean
13-
python-version:
14-
description: 'Python version to install'
15-
required: false
16-
default: '3.12'
1712
kind-version:
1813
description: 'Kind version'
1914
required: false
2015
default: '0.24.0'
2116

2217
jobs:
18+
set-kind-version:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
kind-version: ${{steps.set-kind-version.outputs.kind-version }}
22+
steps:
23+
- name: Set KinD version
24+
id: set-kind-version
25+
env:
26+
KIND_VERSION: '0.24.0'
27+
shell: bash
28+
run: |
29+
if [ "${{ github.event_name }}" == 'workflow_dispatch' ]; then
30+
KIND_VERSION="${{ inputs.kind-version }}"
31+
fi
32+
33+
echo "Set KinD version to: $KIND_VERSION"
34+
echo "kind-version=$KIND_VERSION" >> "$GITHUB_OUTPUT"
35+
2336
run-tests-gateway:
37+
needs: [ set-kind-version ]
2438
runs-on: ubuntu-latest
2539

2640
permissions:
@@ -51,18 +65,14 @@ jobs:
5165
- name: Setup K8S Tools
5266
uses: ./.github/actions/setup-k8s
5367
with:
54-
kind-version: ${{ inputs.kind-version }}
68+
kind-version: ${{ needs.set-kind-version.outputs.kind-version }}
5569

5670
- name: Create kind cluster
57-
run: |
58-
cd integrations
59-
task kind:create
71+
run: task integrations:kind:create
6072
shell: bash
6173

6274
- name: Deploy agntcy agp
63-
run: |
64-
cd integrations
65-
task test:env:gateway:deploy
75+
run: task integrations:gateway:test-env:deploy
6676
shell: bash
6777

6878
- name: Run simple gateway tests
@@ -72,12 +82,11 @@ jobs:
7282
AZURE_DEPLOYMENT_NAME: ${{ vars.AZURE_DEPLOYMENT_NAME }}
7383
AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }}
7484
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
75-
run: |
76-
cd integrations
77-
task test:gateway
85+
run: task integrations:gateway:test
7886
shell: bash
7987

8088
run-tests-directory:
89+
needs: [ set-kind-version ]
8190
runs-on: ubuntu-latest
8291

8392
permissions:
@@ -108,22 +117,16 @@ jobs:
108117
- name: Setup K8S Tools
109118
uses: ./.github/actions/setup-k8s
110119
with:
111-
kind-version: ${{ inputs.kind-version }}
120+
kind-version: ${{ needs.set-kind-version.outputs.kind-version }}
112121

113122
- name: Create kind cluster
114-
run: |
115-
cd integrations
116-
task kind:create
123+
run: task integrations:kind:create
117124
shell: bash
118125

119126
- name: Deploy agntcy dir
120-
run: |
121-
cd integrations
122-
task test:env:directory:deploy
127+
run: task integrations:directory:test-env:deploy
123128
shell: bash
124129

125130
- name: Run agent build tests
126-
run: |
127-
cd integrations
128-
task test:directory
131+
run: task integrations:directory:test
129132
shell: bash

.github/workflows/test-samples.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: ./.github/actions/detect-changes
2828
id: detect-changes
2929
with:
30-
dirs: $(find ./samples \( -name 'pyproject.toml' -o -name 'Taskfile.yaml' \) | xargs -n1 dirname | sort -u)
30+
dirs: $(find ./samples -mindepth 2 \( -name 'pyproject.toml' -o -name 'Taskfile.yml' \) | xargs -n1 dirname | sort -u)
3131

3232
test:
3333
name: Test on samples

Taskfile.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright AGNTCY Contributors (https://github.com/agntcy)
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
---
5+
version: '3'
6+
7+
silent: true
8+
9+
includes:
10+
integrations:
11+
taskfile: ./integrations/Taskfile.yml
12+
dir: ./integrations
13+
samples:
14+
taskfile: ./samples/Taskfile.yml
15+
dir: ./samples
16+
17+
tasks:
18+
default:
19+
cmd: task -l

integrations/Taskfile.yaml

-241
This file was deleted.

0 commit comments

Comments
 (0)