Skip to content

Commit

Permalink
[internal] allow Toolchain plugin to request restriected access token…
Browse files Browse the repository at this point in the history
… for Github Actions PR builds (pantsbuild#11621)

This will allow the Toolchain pants plugin to request a restricted access token in order to allow pants to use Toolchain's Buildsense and remote caching APIs.
  • Loading branch information
asherf committed Mar 9, 2021
1 parent 73e97c2 commit 9141cd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
${{ runner.os }}-engine-${{ steps.get-engine-hash.outputs.hash }}
- name: Set env vars
run: |
echo "PANTS_CONFIG_FILES=${{ github.workspace }}/pants.ci.toml" >> ${GITHUB_ENV}
echo 'PANTS_CONFIG_FILES=+["${{ github.workspace }}/pants.ci.toml", "${{ github.workspace }}/pants.remote-cache.toml"]' >> ${GITHUB_ENV}
- name: Bootstrap Pants
run: |
./pants --version
Expand Down Expand Up @@ -170,7 +170,7 @@ jobs:
path: src/python/pants/engine/internals/
- name: Set env vars
run: |
echo "PANTS_CONFIG_FILES=${{ github.workspace }}/pants.ci.toml" >> ${GITHUB_ENV}
echo 'PANTS_CONFIG_FILES=+["${{ github.workspace }}/pants.ci.toml", "${{ github.workspace }}/pants.remote-cache.toml"]' >> ${GITHUB_ENV}
- name: Run Python tests
run: |
./pants test ::
Expand Down Expand Up @@ -203,13 +203,12 @@ jobs:
path: src/python/pants/engine/internals/
- name: Set env vars
run: |
echo "PANTS_CONFIG_FILES=${{ github.workspace }}/pants.ci.toml" >> ${GITHUB_ENV}
echo 'PANTS_CONFIG_FILES=+["${{ github.workspace }}/pants.ci.toml", "${{ github.workspace }}/pants.remote-cache.toml"]' >> ${GITHUB_ENV}
- name: Lint
run: |
./pants validate '**'
./pants lint typecheck ::
bootstrap_pants_macos:
name: Bootstrap Pants, test Rust (MacOS)
runs-on: macos-10.15
Expand Down Expand Up @@ -283,7 +282,7 @@ jobs:
${{ runner.os }}-engine-${{ steps.get-engine-hash.outputs.hash }}
- name: Set env vars
run: |
echo "PANTS_CONFIG_FILES=${{ github.workspace }}/pants.ci.toml" >> ${GITHUB_ENV}
echo 'PANTS_CONFIG_FILES=+["${{ github.workspace }}/pants.ci.toml", "${{ github.workspace }}/pants.remote-cache.toml"]' >> ${GITHUB_ENV}
- name: Bootstrap Pants
run: |
./pants --version
Expand Down Expand Up @@ -332,7 +331,7 @@ jobs:
path: src/python/pants/engine/internals/
- name: Set env vars
run: |
echo "PANTS_CONFIG_FILES=${{ github.workspace }}/pants.ci.toml" >> ${GITHUB_ENV}
echo 'PANTS_CONFIG_FILES=+["${{ github.workspace }}/pants.ci.toml", "${{ github.workspace }}/pants.remote-cache.toml"]' >> ${GITHUB_ENV}
- name: Run Python tests
run: |
./pants --tag=+platform_specific_behavior test ::
5 changes: 4 additions & 1 deletion pants.ci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ report = ["raw", "xml"]
[auth]
from_env_var = "TOOLCHAIN_AUTH_TOKEN"
org = "pantsbuild"
ci_env_variables = ["TRAVIS", "TRAVIS_JOB_ID", "TRAVIS_BUILD_ID", "TRAVIS_PULL_REQUEST", "TRAVIS_BUILD_WEB_URL"]
ci_env_variables = [
"TRAVIS", "TRAVIS_JOB_ID", "TRAVIS_BUILD_ID", "TRAVIS_PULL_REQUEST", "TRAVIS_BUILD_WEB_URL",
"GITHUB_ACTIONS", "GITHUB_RUN_ID", "GITHUB_REF", "GITHUB_EVENT_NAME", "GITHUB_SHA",
]

[buildsense]
enable = true

0 comments on commit 9141cd3

Please sign in to comment.