100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
CI/CD: update to skip workflow (but mark as complete) if only CI/D files have been modified (#712)
Rich Turnera7a076ca1d63
diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.ymlindex e3da98e51..7374a4b52 100644--- a/.github/workflows/ci_cd.yml+++ b/.github/workflows/ci_cd.yml@@ -60,10 +60,6 @@ on:- '**'tags-ignore:- '*.*'- paths-ignore:- - '.github/**'- - '.ci_cd/**'- - '**/*.md'# When a release is publishedrelease:@@ -102,7 +98,7 @@ jobs:steps:- - name: Cancel Previous Runs+ - name: Cancel previous runsuses: styfle/[email protected]with:access_token: ${{ github.token }}@@ -167,8 +163,24 @@ jobs:with:# This will only be available when run by workflow_dispatch otherwise will checkout branch/commit that triggered the workflowref: ${{ steps.inputs-and-secrets.outputs.COMMIT }}+ fetch-depth: 0submodules: recursive-++ # We use this to exit workflow if only CI/CD files have changed+ - name: Get changed files+ id: changed-files+ uses: tj-actions/changed-files@v20+ with:+ files_ignore: |+ .ci_cd/**+ **/*.md+ **/*.yml++ - name: Set skip flag if only CI/CD files have changed+ id: skip-cicd+ if: github.event_name == 'push' && steps.changed-files.outputs.only_modified != 'true'+ run: echo "::set-output name=value::true"+- name: Make cache dirs and set file permissionsrun: |chmod +x gradlew@@ -376,6 +388,7 @@ jobs:cp -r . ~/manager-tags-old/- name: Sanitize deployments value+ if: steps.skip-cicd.outputs.value != 'true'id: deploymentsrun: |deployments=$DEPLOYMENTS@@ -396,16 +409,17 @@ jobs:- name: Define backend test commandid: test-backend-command- if: ${{ github.event_name == 'push' || github.event_name == 'release' }}+ if: ${{ github.event_name == 'push' && steps.skip-cicd.outputs.value != 'true' }}run: echo "::set-output name=value::./gradlew -p test test"- name: Define UI test commandid: test-ui-command- if: ${{ github.event_name == 'push' || github.event_name == 'release' }}+ if: ${{ github.event_name == 'push' && steps.skip-cicd.outputs.value != 'true' }}run: echo ""- name: Define manager docker build commandid: manager-docker-command+ if: ${{ steps.skip-cicd.outputs.value != 'true' }}shell: bashrun: |if [ $IS_CUSTOM_PROJECT == 'true' ]; then@@ -439,6 +453,7 @@ jobs:- name: Define deployment docker build commandid: deployment-docker-command+ if: ${{ steps.skip-cicd.outputs.value != 'true' }}shell: bashrun: |if [ "$DEPLOYMENT_DOCKERFILE_EXISTS" == 'true' ]; then@@ -465,6 +480,7 @@ jobs:- name: Define installDist commandid: install-command+ if: steps.skip-cicd.outputs.value != 'true'shell: bashrun: |if [ -n "$MANAGER_DOCKER_CMD" ]; then@@ -512,6 +528,7 @@ jobs:- name: Set up JDK 17 and gradle cacheid: java+ if: steps.skip-cicd.outputs.value != 'true'uses: actions/setup-java@v3with:distribution: 'temurin'@@ -524,6 +541,7 @@ jobs:- name: Yarn cacheuses: actions/[email protected]+ if: steps.skip-cicd.outputs.value != 'true'id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)with:path: ${{ steps.yarn-cache-dir-path.outputs.dir }}@@ -550,6 +568,7 @@ jobs:- name: Output info+ if: steps.skip-cicd.outputs.value != 'true'run: |echo "************************************************************"echo "************** INFO *******************"