Skip to content

Commit

Permalink
Attach tachometer checks to the right commit and distinguish with lab…
Browse files Browse the repository at this point in the history
…el. (#941)
  • Loading branch information
aomarks committed Jun 6, 2019
1 parent 1b40433 commit 97047f1
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 42 deletions.
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}"

0 comments on commit 97047f1

Please sign in to comment.