forked from facebook/buck2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
buck2/github: simplify Windows and Mac setup
Summary: Current setup steps are copied from CirleCI, Github allows to do this easier and faster. `setup_windows_env` **3m12s** -> **46s**: https://github.com/KapJI/buck2/actions/runs/11840491142/job/32994456976 * Use `dtolnay/rust-toolchain` on all platforms. It also configures Cargo a bit, e.g. enabled coloured output. * `rustup` is already installed on Windows runners: https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md#rust-tools * `actions/checkout` is performed on job level, these actions are duplicated. Differential Revision: D66010956
- Loading branch information
1 parent
d7c4e94
commit ca55500
Showing
4 changed files
with
24 additions
and
30 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,17 +3,22 @@ description: Setup macOS environment | |
runs: | ||
using: composite | ||
steps: | ||
- name: Install Rustup | ||
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=none | ||
shell: bash | ||
- uses: SebRollen/[email protected] | ||
id: read_rust_toolchain | ||
with: | ||
file: rust-toolchain | ||
field: toolchain.channel | ||
- uses: dtolnay/rust-toolchain@v1 | ||
with: | ||
toolchain: ${{ steps.read_rust_toolchain.outputs.value }} | ||
components: clippy | ||
- name: Brew install | ||
run: brew install cmake python3 coreutils opam llvm protobuf zstd | ||
shell: bash | ||
- name: Install conan | ||
run: sudo pip3 install --break-system-packages conan==1.* | ||
shell: bash | ||
- uses: "./.github/actions/print_versions" | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '~1.22.0' | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,29 +3,25 @@ description: Setup Windows environment for building and testing | |
runs: | ||
using: composite | ||
steps: | ||
- name: Install Rustup | ||
run: |- | ||
choco install -y rustup.install | ||
write-output "[net]`ngit-fetch-with-cli = true" | out-file -append -encoding utf8 $Env:USERPROFILE/.cargo/config.toml | ||
type $Env:USERPROFILE/.cargo/config.toml | ||
shell: pwsh | ||
- name: Create python3 symlink | ||
run: New-Item -ItemType SymbolicLink -Path C:\ProgramData\chocolatey\bin\python3.exe -Target $(Get-Command python).Source | ||
shell: pwsh | ||
- name: Write Powershell profile | ||
- name: Write Visual Studio path | ||
run: |- | ||
$psProfileContent = @' | ||
$vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.VisualStudio.Component.VC.Llvm.Clang -property installationPath | ||
$llvmPath = Join-Path $vsPath "VC\Tools\Llvm\x64\bin" | ||
$env:PATH = "$env:USERPROFILE\.cargo\bin;$llvmPath;" + $env:PATH | ||
$env:TEMP = "$env:USERPROFILE\temp" | ||
$env:TMP = $env:TEMP | ||
'@ | ||
Add-Content "$PsHome\profile.ps1" $psProfileContent | ||
New-Item -ItemType Directory -Path "$env:USERPROFILE\temp" | ||
Join-Path $vsPath "VC\Tools\Llvm\x64\bin" | Out-File -FilePath $env:GITHUB_PATH -Append | ||
shell: pwsh | ||
- uses: "./.github/actions/print_versions" | ||
- uses: actions/checkout@v4 | ||
- name: Create python3 symlink | ||
run: | | ||
New-Item -ItemType SymbolicLink -Path C:\ProgramData\chocolatey\bin\python3.exe -Target $(Get-Command python).Source | ||
shell: pwsh | ||
- uses: SebRollen/[email protected] | ||
id: read_rust_toolchain | ||
with: | ||
file: rust-toolchain | ||
field: toolchain.channel | ||
- uses: dtolnay/rust-toolchain@v1 | ||
with: | ||
toolchain: ${{ steps.read_rust_toolchain.outputs.value }} | ||
components: clippy | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '~1.22.0' |
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