Skip to content

feat: stage commit of the OSS CSIT repo #4

feat: stage commit of the OSS CSIT repo

feat: stage commit of the OSS CSIT repo #4

Workflow file for this run

# SPDX-FileCopyrightText: Copyright (c) 2025 Cisco and/or its affiliates.
# 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 \( -name 'pyproject.toml' -o -name 'Taskfile.yaml' \) | 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 Taskfile
shell: bash
run: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
- name: Setup Python
uses: ./.github/actions/setup-python
with:
py-version: "3.12"
- name: Setup K8S Tools
uses: ./.github/actions/setup-k8s
with:
kind-version: "0.25.0"
- name: Run tests
env:
POETRY_REPOSITORIES_DEVHUBCLOUD_URL: "https://artifactory.devhub-cloud.cisco.com/artifactory/api/pypi/espresso-cloud-pypi"
POETRY_HTTP_BASIC_DEVHUBCLOUD_USERNAME: ${{ secrets.DEVHUB_CLOUD_USERNAME }}
POETRY_HTTP_BASIC_DEVHUBCLOUD_PASSWORD: ${{ secrets.DEVHUB_CLOUD_TOKEN }}
run: |
cd ${{ matrix.app }}
task run:test
shell: bash