2016-09-21 17:46:00 +03:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
2018-04-02 15:49:03 +03:00
|
|
|
report_error ()
|
|
|
|
{
|
2018-05-24 16:04:14 +03:00
|
|
|
printf "🔥 [Test run failed]($BUILD_URL/Test_20Report/) 🔥\\n" >> $WORKSPACE/jenkins/pr-comments.md
|
2018-04-02 15:49:03 +03:00
|
|
|
|
|
|
|
if test -f $WORKSPACE/tests/TestSummary.md; then
|
|
|
|
printf "\\n" >> $WORKSPACE/jenkins/pr-comments.md
|
|
|
|
cat $WORKSPACE/tests/TestSummary.md >> $WORKSPACE/jenkins/pr-comments.md
|
|
|
|
fi
|
2018-04-04 16:36:30 +03:00
|
|
|
|
|
|
|
touch $WORKSPACE/jenkins/failure-stamp
|
2018-04-02 15:49:03 +03:00
|
|
|
}
|
|
|
|
trap report_error ERR
|
|
|
|
|
2016-11-15 21:04:37 +03:00
|
|
|
export BUILD_REVISION=jenkins
|
2016-09-21 17:46:00 +03:00
|
|
|
cd $WORKSPACE
|
|
|
|
# Unlock
|
|
|
|
security default-keychain -s builder.keychain
|
|
|
|
security list-keychains -s builder.keychain
|
|
|
|
echo "Unlock keychain"
|
2017-09-27 20:31:19 +03:00
|
|
|
security unlock-keychain -p `cat ~/.config/keychain`
|
2016-09-21 17:46:00 +03:00
|
|
|
echo "Increase keychain unlock timeout"
|
|
|
|
security set-keychain-settings -lut 7200
|
|
|
|
|
2018-05-29 14:18:03 +03:00
|
|
|
# Prevent dialogs from asking for permissions.
|
|
|
|
# http://stackoverflow.com/a/40039594/183422
|
|
|
|
security set-key-partition-list -S apple-tool:,apple: -s -k `cat ~/.config/keychain` builder.keychain
|
|
|
|
|
2018-03-15 20:25:53 +03:00
|
|
|
# clean mono keypairs (used in tests)
|
|
|
|
rm -rf ~/.config/.mono/keypairs/
|
|
|
|
|
2016-09-21 17:46:00 +03:00
|
|
|
# Run tests
|
|
|
|
make -C tests jenkins
|
2018-04-02 15:49:03 +03:00
|
|
|
|
2018-05-24 16:04:14 +03:00
|
|
|
printf "✅ [Test run succeeded]($BUILD_URL/Test_20Report/)\\n" >> $WORKSPACE/jenkins/pr-comments.md
|
2018-04-04 16:36:30 +03:00
|
|
|
|
|
|
|
if test -f $WORKSPACE/jenkins/failure-stamp; then
|
|
|
|
echo "Something went wrong:"
|
|
|
|
cat $WORKSPACE/jenkins/pr-comments.md
|
|
|
|
exit 1
|
|
|
|
fi
|