aboutsummaryrefslogtreecommitdiffstats
path: root/.travis.yml
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-05-25 07:10:16 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-05-25 08:40:00 +0530
commit490df640b47cb252636a9476552d7ecea01a11e7 (patch)
treee167785cdc668be7edf151116adcd74ea3bcc3b8 /.travis.yml
parentAdded config to generate a windows MSI installer. (diff)
downloadferdium-app-490df640b47cb252636a9476552d7ecea01a11e7.tar.gz
ferdium-app-490df640b47cb252636a9476552d7ecea01a11e7.tar.zst
ferdium-app-490df640b47cb252636a9476552d7ecea01a11e7.zip
Skip building in the 'script' stage of travis if no changes found.
Diffstat (limited to '.travis.yml')
-rw-r--r--.travis.yml60
1 files changed, 37 insertions, 23 deletions
diff --git a/.travis.yml b/.travis.yml
index ae29f3b4c..aefeedfc7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -45,42 +45,56 @@ before_install:
45 git remote add source https://${GH_TOKEN}@github.com/getferdi/ferdi.git > /dev/null 2>&1 45 git remote add source https://${GH_TOKEN}@github.com/getferdi/ferdi.git > /dev/null 2>&1
46 git fetch source 46 git fetch source
47 git merge --no-ff --commit -m "Merge remote-tracking branch 'source/develop' into HEAD [skip ci]" source/develop 47 git merge --no-ff --commit -m "Merge remote-tracking branch 'source/develop' into HEAD [skip ci]" source/develop
48 CHANGES_COUNT=$(git diff --stat HEAD origin/nightly | wc -l) 48 CHANGES_COUNT=$(git diff --shortstat HEAD origin/$TRAVIS_BRANCH | wc -l)
49 echo "Travis event type: $TRAVIS_EVENT_TYPE" 49 echo "Travis event type: $TRAVIS_EVENT_TYPE"
50 echo "Number of changes: $CHANGES_COUNT" 50 echo "Number of changes: $CHANGES_COUNT"
51 if [ $CHANGES_COUNT -eq 0 -a $TRAVIS_EVENT_TYPE == "cron" ]; then 51 if [ $CHANGES_COUNT -eq 0 -a $TRAVIS_EVENT_TYPE == "cron" ]; then
52 echo "Terminating the build since there are no changes in a cron-triggered build" 52 export SHOULD_CONTINUE_BUILD="false"
53 travis_terminate 0 53 echo "Exporting SHOULD_CONTINUE_BUILD to false for future stages"
54 else 54 else
55 echo "Found changes, proceeding with submodule updates" 55 echo "Found changes, proceeding with submodule updates"
56 git submodule update --remote --force 56 git submodule update --remote --force
57 git commit -am "Update submodules [skip ci]" --no-verify || true 57 git commit -am "Update submodules [skip ci]" --no-verify
58 echo "Completed merging from develop branch and upgrading submodules"
58 fi 59 fi
59 echo "Completed merging from develop branch and upgrading submodules"
60 fi 60 fi
61install: 61install:
62 - travis_retry npm cache clean -f || travis_terminate 1 62 - |
63 - travis_retry npm uninstall node-gyp || travis_terminate 1 63 if [ "$SHOULD_CONTINUE_BUILD" == "false" ]; then
64 - travis_retry npm i -g node-gyp@8.0.0 || travis_terminate 1 64 echo "Skipping install stage since SHOULD_CONTINUE_BUILD: $SHOULD_CONTINUE_BUILD"
65 - cd recipes && npm i && npm run package && cd .. || travis_terminate 1 65 else
66 - travis_retry npx lerna bootstrap || travis_terminate 1 66 travis_retry npm cache clean -f || travis_terminate 1
67 travis_retry npm uninstall node-gyp || travis_terminate 1
68 travis_retry npm i -g node-gyp@8.0.0 || travis_terminate 1
69 cd recipes && npm i && npm run package && cd .. || travis_terminate 1
70 travis_retry npx lerna bootstrap || travis_terminate 1
71 fi
67before_script: 72before_script:
68 - npm run lint && npm run test || travis_terminate 1 73 - |
74 if [ "$SHOULD_CONTINUE_BUILD" == "false" ]; then
75 echo "Skipping before_script stage since SHOULD_CONTINUE_BUILD: $SHOULD_CONTINUE_BUILD"
76 else
77 npm run lint && npm run test || travis_terminate 1
78 fi
69script: 79script:
70 - | 80 - |
71 echo "Building for branch: $TRAVIS_BRANCH" 81 if [ "$SHOULD_CONTINUE_BUILD" == "false" ]; then
72 if [ $TRAVIS_BRANCH == "release" ]; then 82 echo "Terminating the build since there are no changes in a cron-triggered build"
73 travis_retry travis_wait 100 npm run build -- --publish always -c.publish.provider=github -c.publish.owner=getferdi -c.publish.repo=ferdi -c.mac.identity=null || travis_terminate 1 83 travis_terminate 0
74 elif [ $TRAVIS_BRANCH == "nightly" ]; then 84 exit 0 # Note: Bug fix since 'travis_terminate' doesn't seem to exit immediately
75 git commit -am "Apply linter fixes [skip ci]" --no-verify
76 npm version prerelease --preid=nightly -m "%s and trigger AppVeyor nightly build [skip travisci]" || travis_terminate 1
77 if [ $TRAVIS_OS_NAME == "osx" ]; then
78 git remote add nightly https://${GH_TOKEN}@github.com/getferdi/ferdi.git > /dev/null 2>&1
79 git push -qu nightly HEAD:nightly --no-verify >/dev/null 2>&1
80 fi
81 travis_retry travis_wait 100 npm run build -- --publish always -c.publish.provider=github -c.publish.owner=getferdi -c.publish.repo=nightlies || travis_terminate 1
82 else 85 else
83 if [ $TRAVIS_PULL_REQUEST_BRANCH != "i18n" ]; then 86 echo "Building for branch: $TRAVIS_BRANCH"
87 if [ $TRAVIS_BRANCH == "release" ]; then
88 travis_retry travis_wait 100 npm run build -- --publish always -c.publish.provider=github -c.publish.owner=getferdi -c.publish.repo=ferdi -c.mac.identity=null || travis_terminate 1
89 elif [ $TRAVIS_BRANCH == "nightly" ]; then
90 git commit -am "Apply linter fixes [skip ci]" --no-verify
91 npm version prerelease --preid=nightly -m "%s and trigger AppVeyor nightly build [skip travisci]" || travis_terminate 1
92 if [ $TRAVIS_OS_NAME == "osx" ]; then
93 git remote add source https://${GH_TOKEN}@github.com/getferdi/ferdi.git > /dev/null 2>&1
94 git push -qu source HEAD:$TRAVIS_BRANCH --no-verify >/dev/null 2>&1
95 fi
96 travis_retry travis_wait 100 npm run build -- --publish always -c.publish.provider=github -c.publish.owner=getferdi -c.publish.repo=nightlies || travis_terminate 1
97 elif [ $TRAVIS_PULL_REQUEST_BRANCH != "i18n" ]; then
84 travis_retry travis_wait 100 npm run build || travis_terminate 1 98 travis_retry travis_wait 100 npm run build || travis_terminate 1
85 fi 99 fi
86 fi 100 fi