From f850d6b745265df2746e91c30d6c9484b419e5b1 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 1 Dec 2022 15:04:14 -0800 Subject: [PATCH] Checkout and install from repo, instead of --git --- .github/workflows/buck2.yml | 3 ++- .github/workflows/build.yml | 14 ++++++++++++-- .../workflows/rustup-toolchain-install-master.yml | 4 ++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/buck2.yml b/.github/workflows/buck2.yml index 04e0809..e5a513e 100644 --- a/.github/workflows/buck2.yml +++ b/.github/workflows/buck2.yml @@ -10,7 +10,8 @@ jobs: uses: ./.github/workflows/build.yml with: crate: buck2 - git: https://github.com/facebookincubator/buck2 + git: facebookincubator/buck2 + path: cli permissions: contents: write secrets: inherit diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7d57485..8b7818e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,10 @@ on: git: required: false type: string - branch: + ref: + required: false + type: string + path: required: false type: string secrets: @@ -28,8 +31,15 @@ jobs: timeout-minutes: 45 steps: - uses: actions/checkout@v3 + - uses: actions/checkout@v3 + with: + repository: ${{inputs.git}} + ref: ${{inputs.ref}} + path: ${{inputs.crate}} + if: inputs.git - uses: dtolnay/rust-toolchain@stable - - run: cargo install --force ${{inputs.crate}} --bin ${{inputs.bin || inputs.crate}} ${{inputs.git && format('--git={0}', inputs.git) || ''}} ${{inputs.branch && format('--branch={0}', inputs.branch) || ''}} + - run: cargo install --force ${{inputs.git && format('--path={0}', inputs.path || '.') || inputs.crate}} --bin ${{inputs.bin || inputs.crate}} + working-directory: ${{inputs.git && inputs.crate || '.'}} - id: which run: echo "which=$(which ${{inputs.bin || inputs.crate}})" >> $GITHUB_OUTPUT - id: version diff --git a/.github/workflows/rustup-toolchain-install-master.yml b/.github/workflows/rustup-toolchain-install-master.yml index 67860e5..9104f73 100644 --- a/.github/workflows/rustup-toolchain-install-master.yml +++ b/.github/workflows/rustup-toolchain-install-master.yml @@ -10,8 +10,8 @@ jobs: uses: ./.github/workflows/build.yml with: crate: rustup-toolchain-install-master - git: https://github.com/dtolnay-contrib/rustup-toolchain-install-master - branch: nodefault + git: dtolnay-contrib/rustup-toolchain-install-master + ref: nodefault permissions: contents: write secrets: inherit