Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distinguish PR from branch builds in Tachometer checks #941

Merged
merged 1 commit into from Jun 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
78 changes: 39 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -44,7 +44,7 @@
"rollup": "^0.64.1",
"rollup-plugin-filesize": "^4.0.1",
"rollup-plugin-terser": "^1.0.1",
"tachometer": "^0.4.0",
"tachometer": "^0.4.1",
"tslint": "^5.11.0",
"typescript": "^3.4.1",
"uglify-es": "^3.3.5",
Expand Down
17 changes: 15 additions & 2 deletions travis-bench.sh
Expand Up @@ -38,7 +38,20 @@ if [[ "${TRAVIS_SECURE_ENV_VARS}" == "true" ]]; then
# https://github.com/organizations/Polymer/settings/installations
# by clicking "Configure" and looking at the URL.
INSTALLATION_ID=851456
GITHUB_CHECK="{\"appId\":${APP_ID},\"installationId\":${INSTALLATION_ID},\"repo\":\"${TRAVIS_REPO_SLUG}\",\"commit\":\"${TRAVIS_COMMIT}\"}"

if [[ "${TRAVIS_PULL_REQUEST}" == "false" ]]; then
CHECK_LABEL="Tachometer - Branch"
CHECK_COMMIT="${TRAVIS_COMMIT}"
else
CHECK_LABEL="Tachometer - Pull Request"
# Note that for a PR, $TRAVIS_COMMIT will be the SHA of the generated merge
# commit, but in order to show up in the GitHub UI we need to instead attach
# the check to the feature branch SHA.
CHECK_COMMIT="${TRAVIS_PULL_REQUEST_SHA}"
fi

GITHUB_CHECK="{\"label\":\"${CHECK_LABEL}\",\"appId\":${APP_ID},\"installationId\":${INSTALLATION_ID},\"repo\":\"${TRAVIS_REPO_SLUG}\",\"commit\":\"${CHECK_COMMIT}\"}"

else
# We can't report a GitHub Check unless this is a trusted build with access to
# our GitHub App's private key. Note that benchmark results can still be seen
Expand All @@ -54,4 +67,4 @@ npx tach $BENCHMARK \
--package-version=this=lit-html@github:${THIS} \
--package-version=parent=lit-html@github:${PARENT} \
--package-version=published=lit-html@* \
--github-check=$GITHUB_CHECK
--github-check="${GITHUB_CHECK}"