Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions .github/actions/deploy-components/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,34 @@
name: Deploy agntcy components
description: Deploy agntcy components for integration testing
inputs:
checkout-repository:
description: 'Checkout AGNTCY repository'
required: false
default: 'false'
checkout-path:
description: 'Path to checkout AGNTCY repository'
required: false
default: ''
deploy-gateway:
description: 'Deploy gateway to a kind cluster'
required: false
default: 'false'
gateway-image-version:
gateway-image-tag:
description: 'Set gateway container image version'
required: false
default: ''
deploy-directory:
description: 'Deploy directory to a kind cluster'
required: false
default: 'false'
directory-image-version:
directory-image-tag:
description: 'Set directory container image version'
required: false
default: ''
kind-cluster-name:
description: 'Set kind cluster name where components are deployed'
required: false
default: 'agntcy-components'
default: 'agntcy-test'
kind-cluster-namespace:
description: 'Set cluster namespace where components are deployed'
required: false
Expand All @@ -50,11 +58,12 @@ runs:
using: composite
steps:
- name: Checkout agntcy repository
if: ${{ inputs.checkout-repository != 'false' }}
uses: actions/checkout@v4
with:
repository: 'agntcy/csit'
ref: ${{ inputs.github-repository-ref }}
path: 'agntcy-csit'
path: ${{ inputs.checkout-path }}

- name: Install KinD
if: ${{ inputs.install-kind-depedency != 'false' }}
Expand All @@ -81,31 +90,26 @@ runs:
with:
version: 3.x

# Maybe /usr/local/bin is already in PATH by default
# - name: Update GITHUB_PATH
# shell: bash
# run: echo "/usr/local/bin" >> $GITHUB_PATH

- name: Create kind cluster
shell: bash
run: |
task -d agntcy-csit/ integrations:kind:create \
task -d ./${{ inputs.checkout-path }} integrations:kind:create \
KIND_CLUSTER_NAME=${{ inputs.kind-cluster-name }}

- name: Deploy Gateway
if: ${{ inputs.deploy-gateway != 'false' }}
shell: bash
run: |
task -d agntcy-csit/ integrations:gateway:test-env:deploy \
GATEWAY_IMAGE_TAG=${{ inputs.gateway-image-version }} \
task -d ./${{ inputs.checkout-path }} integrations:gateway:test-env:deploy \
GATEWAY_IMAGE_TAG=${{ inputs.gateway-image-tag }} \
KIND_CLUSTER_NAME=${{ inputs.kind-cluster-name }} \
HELM_NAMESPACE=${{ inputs.kind-cluster-namespace }}

- name: Deploy Directory
if: ${{ inputs.deploy-directory != 'false' }}
shell: bash
run: |
task -d agntcy-csit/ integrations:directory:test-env:deploy \
DIRECTORY_IMAGE_TAG=${{ inputs.directory-image-version }} \
task -d ./${{ inputs.checkout-path }} integrations:directory:test-env:deploy \
DIRECTORY_IMAGE_TAG=${{ inputs.directory-image-tag }} \
KIND_CLUSTER_NAME=${{ inputs.kind-cluster-name }} \
HELM_NAMESPACE=${{ inputs.kind-cluster-namespace }}
39 changes: 21 additions & 18 deletions .github/workflows/test-integrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@ on:
pull_request:
workflow_dispatch:
inputs:
kind-version:
kind_version:
description: 'Kind version'
required: false
default: '0.24.0'

override_directory_image_tag:
description: 'Directory image tag'
required: false
default: ''
override_gateway_image_tag:
description: 'Gateway image tag'
required: false
default: ''
jobs:
set-kind-version:
runs-on: ubuntu-latest
Expand All @@ -27,7 +34,7 @@ jobs:
shell: bash
run: |
if [ "${{ github.event_name }}" == 'workflow_dispatch' ]; then
KIND_VERSION="${{ inputs.kind-version }}"
KIND_VERSION="${{ inputs.kind_version }}"
fi

echo "Set KinD version to: $KIND_VERSION"
Expand Down Expand Up @@ -67,13 +74,11 @@ jobs:
with:
kind-version: ${{ needs.set-kind-version.outputs.kind-version }}

- name: Create kind cluster
run: task integrations:kind:create
shell: bash

- name: Deploy agntcy agp
run: task integrations:gateway:test-env:deploy
shell: bash
- name: Deploy Gateway
uses: ./.github/actions/deploy-components
with:
deploy-gateway: 'true'
gateway-image-tag: ${{ inputs.override_gateway_image_tag }}

- name: Run simple gateway tests
env:
Expand Down Expand Up @@ -119,14 +124,12 @@ jobs:
with:
kind-version: ${{ needs.set-kind-version.outputs.kind-version }}

- name: Create kind cluster
run: task integrations:kind:create
shell: bash

- name: Deploy agntcy dir
run: task integrations:directory:test-env:deploy
shell: bash
- name: Deploy Directory
uses: ./.github/actions/deploy-components
with:
deploy-directory: 'true'
directory-image-tag: ${{ inputs.override_directory_image_tag}}

- name: Run agent build tests
- name: Run Directory tests
run: task integrations:directory:test
shell: bash
28 changes: 28 additions & 0 deletions .github/workflows/test-remote-workflow-dispatch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright AGNTCY Contributors (https://github.com/agntcy)
# SPDX-License-Identifier: Apache-2.0

name: test-remote-workflow-dispatch-trigger
on:
workflow_dispatch:
pull_request:

jobs:
trigger-integration-workflow:
runs-on: ubuntu-latest
permissions: write-all # TODO: Find the correct permission or create PAT token
steps:
- name: Repository Dispatch
uses: actions/github-script@v7
with:
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'agntcy',
repo: 'csit',
workflow_id: 'test-integrations.yaml',
ref: 'feat/gh-action-repository-dispatch',
inputs: {
override_gateway_image_tag: '0.3.11',
override_directory_image_tag: 'v0.2.1',
},
});
debug: true
4 changes: 4 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ includes:
integrations:
taskfile: ./integrations/Taskfile.yml
dir: ./integrations
vars:
DIRECTORY_IMAGE_TAG: '{{ .DIRECTORY_IMAGE_TAG }}'
GATEWAY_IMAGE_TAG: '{{ .GATEWAY_IMAGE_TAG }}'

samples:
taskfile: ./samples/Taskfile.yml
dir: ./samples
Expand Down
Loading