Skip to content

feat: implement v1.4 directory services #164

feat: implement v1.4 directory services

feat: implement v1.4 directory services #164

Workflow file for this run

# Copyright AGNTCY Contributors (https://github.com/agntcy)
# SPDX-License-Identifier: Apache-2.0
name: CI
on:
push:
branches:
- main
tags:
- "v*.*.*"
pull_request:
workflow_dispatch:
inputs:
dir_chart_version:
required: false
type: string
description: "Override the version of the dir Helm chart to install for the tests."
dirctl_image_tag:
required: false
type: string
description: "Override the tag of the dir-ctl Docker image to use in the tests."
permissions:
contents: write
packages: write
id-token: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
code: ${{ steps.result.outputs.code }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check for code changes
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: filter
with:
filters: |
code:
- '!CHANGELOG.md'
- '!CODE_OF_CONDUCT.md'
- '!CONTRIBUTING.md'
- '!LICENSE.md'
- '!MAINTAINERS.md'
- '!README.md'
- '!RELEASE.md'
- '!SECURITY.md'
- '!.gitignore'
- name: Determine result
id: result
run: |
# Always run for tag pushes (releases), otherwise use paths-filter result
if [[ "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then
echo "code=true" >> $GITHUB_OUTPUT
else
echo "code=${{ steps.filter.outputs.code }}" >> $GITHUB_OUTPUT
fi
lint:
name: Lint
needs: [changes]
if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Task
uses: go-task/setup-task@01a4adf9db2d14c1de7a560f09170b6e0df736aa # v2.1.0
- name: Lint Python SDK
run: task lint
test:
name: Test
needs:
- changes
uses: ./.github/workflows/reusable-test-sdk.yaml
with:
dir_chart_version: ${{ inputs.dir_chart_version }}
dirctl_image_tag: ${{ inputs.dirctl_image_tag }}
release:
name: Release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs:
- test
uses: ./.github/workflows/reusable-release-sdk.yaml
secrets: inherit
success:
name: Success
if: ${{ !cancelled() && !contains(needs.*.result, 'cancelled') && !contains(needs.*.result, 'failure') }}
needs:
- changes
- lint
- test
- release
runs-on: ubuntu-latest
steps:
- name: Echo Success
run: |
if [[ "${{ needs.changes.outputs.code }}" == "true" ]]; then
echo "::notice Success! All code checks passed."
else
echo "::notice Success! No code changes detected, skipped builds and tests."
fi