Skip to content

Commit 2687712

Browse files
committed
ci: fix checking for presence of CI_GITHUB_API_KEY
CI_GITHUB_API_KEY is always set when evaluating job include/exclude conditions, and it only gets removed when the job starts. Move the check into the script.
1 parent 8ede8f1 commit 2687712

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

.travis.yml

+13-10
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,25 @@ jobs:
6363
- BUILD_TYPE=style_check
6464
install:
6565
- >
66-
[ "$BUILD_TYPE" = "style_check" ] && {
67-
[ -f $HOME/astyle/build/gcc/bin/astyle ] || {
68-
wget -O astyle_3.1_linux.tar.gz https://sourceforge.net/projects/astyle/files/astyle/astyle%203.1/astyle_3.1_linux.tar.gz/download;
69-
tar -xf astyle_3.1_linux.tar.gz -C $HOME;
70-
make -C $HOME/astyle/build/gcc;
71-
}
72-
make -C $HOME/astyle/build/gcc prefix=$HOME install;
73-
} || true
66+
if [ ! -f $HOME/astyle/build/gcc/bin/astyle ]; then
67+
wget -O astyle_3.1_linux.tar.gz https://sourceforge.net/projects/astyle/files/astyle/astyle%203.1/astyle_3.1_linux.tar.gz/download;
68+
tar -xf astyle_3.1_linux.tar.gz -C $HOME;
69+
make -C $HOME/astyle/build/gcc;
70+
fi
71+
make -C $HOME/astyle/build/gcc prefix=$HOME install;
7472
7573
# Deploy stage.
7674
# Here we build the package JSON (always) and do the deployments
7775
- name: "Package / deploy"
7876
stage: deploy
79-
script: $TRAVIS_BUILD_DIR/tests/common.sh
77+
script:
78+
- >
79+
if [ -n "$CI_GITHUB_API_KEY" ]; then
80+
$TRAVIS_BUILD_DIR/tests/common.sh
81+
else
82+
echo "Not building the package."
83+
fi
8084
env: BUILD_TYPE=package
81-
if: env(CI_GITHUB_API_KEY) IS present
8285
deploy:
8386
# Create Github release, upload artifacts
8487
- provider: releases

0 commit comments

Comments
 (0)