Create _setup.yml
to wrap common setup steps.
#3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Set up PyTorch/XLA | |
inputs: | |
torch-commit: | |
required: true | |
type: string | |
remote-cache: | |
required: true | |
type: boolean | |
description: Whether to set up Google Cloud credentials for Bazel cache. | |
runs: | |
using: "composite" | |
steps: | |
# See https://github.com/actions/checkout/issues/1014#issuecomment-1906802802 | |
- name: Clean up workspace | |
run: | | |
ls -la | |
rm -rvf ${GITHUB_WORKSPACE}/* | |
- name: Setup gcloud | |
shell: bash | |
run: | | |
echo "${GCLOUD_SERVICE_KEY}" > /tmp/default_credentials.json | |
echo "GOOGLE_APPLICATION_CREDENTIALS=/tmp/default_credentials.json" >> $GITHUB_ENV | |
if: ${{ inputs.remote-cache }} | |
- name: Checkout PyTorch Repo | |
uses: actions/checkout@v4 | |
with: | |
repository: pytorch/pytorch | |
path: pytorch | |
ref: ${{ inputs.torch-commit }} | |
submodules: recursive | |
- name: Checkout PyTorch/XLA Repo | |
uses: actions/checkout@v4 | |
with: | |
path: pytorch/xla |