Skip to content

feat(dir-sdk-javascript): initial commit #3

feat(dir-sdk-javascript): initial commit

feat(dir-sdk-javascript): initial commit #3

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:
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:
- '!docs/**'
- '!README.md'
- '!CHANGELOG.md'
- '!CONTRIBUTING.md'
- '!CODE_OF_CONDUCT.md'
- '!SECURITY.md'
- '!LICENSE.md'
- '!MAINTAINERS.md'
- '!CONTRIBUTORS.md'
- '!AUTHZ.md'
- '!API_SPEC.md'
- '!RELEASE.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
test:
name: Test
needs:
- changes
uses: ./.github/workflows/reusable-test-sdk.yaml
with:
image_repo: ghcr.io/agntcy
image_tag: ${{ github.sha }}
success:
name: Success
if: ${{ !cancelled() && !contains(needs.*.result, 'cancelled') && !contains(needs.*.result, 'failure') }}
needs:
- changes
- test
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