From 1fb2551a055daf202d2def0fcb3de990a44cfb03 Mon Sep 17 00:00:00 2001 From: Sandeep Nishad Date: Fri, 22 Dec 2023 12:40:45 +0530 Subject: [PATCH] ci(weaver): added conditions to run only when affected corresponding files Signed-off-by: Sandeep Nishad --- .../test_weaver-asset-exchange-besu.yaml | 12 +++ .../test_weaver-asset-exchange-corda.yaml | 12 +++ .../test_weaver-asset-exchange-fabric.yaml | 12 +++ .../workflows/test_weaver-asset-transfer.yaml | 12 +++ .../test_weaver-corda-interop-app.yaml | 8 ++ .../workflows/test_weaver-data-sharing.yaml | 12 +++ .../workflows/test_weaver-docker-build.yaml | 12 +++ .github/workflows/test_weaver-go.yaml | 12 +++ .github/workflows/test_weaver-node-pkgs.yaml | 12 +++ .github/workflows/test_weaver-relay.yaml | 8 ++ weaver/.github/workflows/deploy_docs.yml | 42 ---------- .../workflows/manual_deploy_go-pkgs.yml | 80 ------------------- 12 files changed, 112 insertions(+), 122 deletions(-) delete mode 100644 weaver/.github/workflows/deploy_docs.yml delete mode 100644 weaver/.github/workflows/manual_deploy_go-pkgs.yml diff --git a/.github/workflows/test_weaver-asset-exchange-besu.yaml b/.github/workflows/test_weaver-asset-exchange-besu.yaml index 9e8a8b704b..93f0d7ce2a 100644 --- a/.github/workflows/test_weaver-asset-exchange-besu.yaml +++ b/.github/workflows/test_weaver-asset-exchange-besu.yaml @@ -10,8 +10,20 @@ on: # Triggers the workflow on push or pull request events but only for the main branch push: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/**' + - '!weaver/docs/**' + - '!weaver/rfcs/**' + - '!weaver/resources/**' pull_request: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/**' + - '!weaver/docs/**' + - '!weaver/rfcs/**' + - '!weaver/resources/**' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/test_weaver-asset-exchange-corda.yaml b/.github/workflows/test_weaver-asset-exchange-corda.yaml index 937359ef95..090eb49d86 100644 --- a/.github/workflows/test_weaver-asset-exchange-corda.yaml +++ b/.github/workflows/test_weaver-asset-exchange-corda.yaml @@ -11,8 +11,20 @@ on: # Triggers the workflow on push or pull request events but only for the main branch push: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/**' + - '!weaver/docs/**' + - '!weaver/rfcs/**' + - '!weaver/resources/**' pull_request: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/**' + - '!weaver/docs/**' + - '!weaver/rfcs/**' + - '!weaver/resources/**' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/test_weaver-asset-exchange-fabric.yaml b/.github/workflows/test_weaver-asset-exchange-fabric.yaml index 0564780594..61c90060cb 100644 --- a/.github/workflows/test_weaver-asset-exchange-fabric.yaml +++ b/.github/workflows/test_weaver-asset-exchange-fabric.yaml @@ -14,8 +14,20 @@ on: # Triggers the workflow on push or pull request events but only for the main branch push: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/**' + - '!weaver/docs/**' + - '!weaver/rfcs/**' + - '!weaver/resources/**' pull_request: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/**' + - '!weaver/docs/**' + - '!weaver/rfcs/**' + - '!weaver/resources/**' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/test_weaver-asset-transfer.yaml b/.github/workflows/test_weaver-asset-transfer.yaml index 9d3fa10069..111cd5c034 100644 --- a/.github/workflows/test_weaver-asset-transfer.yaml +++ b/.github/workflows/test_weaver-asset-transfer.yaml @@ -14,8 +14,20 @@ on: # Triggers the workflow on push or pull request events but only for the main branch push: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/**' + - '!weaver/docs/**' + - '!weaver/rfcs/**' + - '!weaver/resources/**' pull_request: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/**' + - '!weaver/docs/**' + - '!weaver/rfcs/**' + - '!weaver/resources/**' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/test_weaver-corda-interop-app.yaml b/.github/workflows/test_weaver-corda-interop-app.yaml index 64a8c2e6e0..c4f90066d9 100644 --- a/.github/workflows/test_weaver-corda-interop-app.yaml +++ b/.github/workflows/test_weaver-corda-interop-app.yaml @@ -10,8 +10,16 @@ name: Unit Test Corda Interop App on: push: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/common/protos-java-kt/**' + - 'weaver/core/network/corda-interop-app/**' pull_request: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/common/protos-java-kt/**' + - 'weaver/core/network/corda-interop-app/**' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/test_weaver-data-sharing.yaml b/.github/workflows/test_weaver-data-sharing.yaml index 7bf92f27da..ae99098277 100644 --- a/.github/workflows/test_weaver-data-sharing.yaml +++ b/.github/workflows/test_weaver-data-sharing.yaml @@ -14,8 +14,20 @@ on: # Triggers the workflow on push or pull request events but only for the main branch push: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/**' + - '!weaver/docs/**' + - '!weaver/rfcs/**' + - '!weaver/resources/**' pull_request: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/**' + - '!weaver/docs/**' + - '!weaver/rfcs/**' + - '!weaver/resources/**' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/test_weaver-docker-build.yaml b/.github/workflows/test_weaver-docker-build.yaml index 32f88f26c0..a309cd249d 100644 --- a/.github/workflows/test_weaver-docker-build.yaml +++ b/.github/workflows/test_weaver-docker-build.yaml @@ -10,8 +10,20 @@ env: on: push: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/**' + - '!weaver/docs/**' + - '!weaver/rfcs/**' + - '!weaver/resources/**' pull_request: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/**' + - '!weaver/docs/**' + - '!weaver/rfcs/**' + - '!weaver/resources/**' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/test_weaver-go.yaml b/.github/workflows/test_weaver-go.yaml index c6664d3c40..7c8bda49f0 100644 --- a/.github/workflows/test_weaver-go.yaml +++ b/.github/workflows/test_weaver-go.yaml @@ -7,8 +7,20 @@ name: Unit Test Fabric Interop CC and Sample Chaincode on: push: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/common/protos-go/**' + - 'weaver/core/network/fabric-interop-cc/**' + - 'weaver/samples/fabric/**' + - '!weaver/samples/fabric/fabric-cli/**' pull_request: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/common/protos-go/**' + - 'weaver/core/network/fabric-interop-cc/**' + - 'weaver/samples/fabric/**' + - '!weaver/samples/fabric/fabric-cli/**' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/test_weaver-node-pkgs.yaml b/.github/workflows/test_weaver-node-pkgs.yaml index 31ff946918..a2ddf9005c 100644 --- a/.github/workflows/test_weaver-node-pkgs.yaml +++ b/.github/workflows/test_weaver-node-pkgs.yaml @@ -14,8 +14,20 @@ env: on: push: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/common/protos-js/**' + - 'weaver/sdks/fabric/interoperation-node-sdk/**' + - 'weaver/core/identity-management/**' + - 'weaver/docs/**' pull_request: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/common/protos-js/**' + - 'weaver/sdks/fabric/interoperation-node-sdk/**' + - 'weaver/core/identity-management/**' + - 'weaver/docs/**' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/test_weaver-relay.yaml b/.github/workflows/test_weaver-relay.yaml index 282dec4f01..e418407f5b 100644 --- a/.github/workflows/test_weaver-relay.yaml +++ b/.github/workflows/test_weaver-relay.yaml @@ -7,8 +7,16 @@ name: Unit Test Relay on: push: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/common/protos-rs/**' + - 'weaver/core/relay/**' pull_request: branches: [ main ] + paths: + - '.github/workflows/test_weaver-**' + - 'weaver/common/protos-rs/**' + - 'weaver/core/relay/**' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/weaver/.github/workflows/deploy_docs.yml b/weaver/.github/workflows/deploy_docs.yml deleted file mode 100644 index 9eeaf8ad5f..0000000000 --- a/weaver/.github/workflows/deploy_docs.yml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Deploy Docs (Github Pages) - -on: - push: - branches: - - main - paths: - - 'docs/**' - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - publish-docs: - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 - - - name: Use Node.js 16.x - uses: actions/setup-node@v2 - with: - node-version: 16.x - - - name: NPM INSTALL - run: npm install - working-directory: weaver/docs - - - name: Build - run: npm run build - working-directory: weaver/docs - - - name: Deploy - uses: JamesIves/github-pages-deploy-action@v4.3.0 - with: - branch: gh-pages # The branch the action should deploy to. - folder: docs/build # The folder the action should deploy. - \ No newline at end of file diff --git a/weaver/.github/workflows/manual_deploy_go-pkgs.yml b/weaver/.github/workflows/manual_deploy_go-pkgs.yml deleted file mode 100644 index 39c2b052b5..0000000000 --- a/weaver/.github/workflows/manual_deploy_go-pkgs.yml +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Deploy General Go Module - -on: - # Allows this to be a reusable workflow - workflow_call: - inputs: - module: - description: 'Go Module name' - required: true - type: string - version: - description: 'Version for Go Release' - required: true - type: string - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - inputs: - module: - description: 'Go Module name' - default: 'protos-go' - required: true - version: - description: 'Version for Go Release' - default: 'v0.0.0' - required: true - -jobs: - release: - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 - - - name: Set current date as env - run: echo "RELEASE_DATE=$(date +%b\ %d,\ %Y)" >> $GITHUB_ENV - - - name: Get Full path - run: | - if [ "${{ inputs.module }}" = "protos-go" ]; then - echo "MODULE_TAG=common/protos-go" >> $GITHUB_ENV - echo "MODULE_DESC=GO Weaver Protos" >> $GITHUB_ENV - elif [ "${{ inputs.module }}" = "interop" ]; then - echo "MODULE_TAG=core/network/fabric-interop-cc/contracts/interop" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Interop Chaincode" >> $GITHUB_ENV - elif [ "${{ inputs.module }}" = "utils" ]; then - echo "MODULE_TAG=core/network/fabric-interop-cc/libs/utils" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Utils Library for Interoperation" >> $GITHUB_ENV - elif [ "${{ inputs.module }}" = "assetexchange" ]; then - echo "MODULE_TAG=core/network/fabric-interop-cc/libs/assetexchange" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Library for Asset Exchange" >> $GITHUB_ENV - elif [ "${{ inputs.module }}" = "asset-mgmt" ]; then - echo "MODULE_TAG=core/network/fabric-interop-cc/interfaces/asset-mgmt" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Asset Management Interface" >> $GITHUB_ENV - elif [ "${{ inputs.module }}" = "go-sdk" ]; then - echo "MODULE_TAG=sdks/fabric/go-sdk" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Weaver SDK" >> $GITHUB_ENV - else - echo "Module not known to the workflow. Exiting." - exit 1 - fi - - - name: Create GO Release - id: go-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ env.MODULE_TAG }}/${{ inputs.version }} - release_name: ${{ inputs.version }} - ${{ env.MODULE_DESC }} - ${{ env.RELEASE_DATE }} - body: | - - Go Module: `github.com/${{ github.repository_owner }}/weaver-dlt-interoperability/${{ env.MODULE_TAG }}` - - Release: ${{ inputs.version }} - - Readme: [Here](https://github.com/${{ github.repository_owner }}/weaver-dlt-interoperability/blob/${{ env.MODULE_TAG }}/${{ inputs.version }}/${{ env.MODULE_TAG }}/README.md). - - Source: [Here](https://github.com/${{ github.repository_owner }}/weaver-dlt-interoperability/blob/${{ env.MODULE_TAG }}/${{ inputs.version }}/${{ env.MODULE_TAG }}) - draft: false - prerelease: false \ No newline at end of file