-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
37 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,42 @@ | ||
# Copyright 2022 The StableHLO Authors. | ||
|
||
# The setup-build action gets everything needed by buildAndTest into the workspace. | ||
# This checks out the proper revision of the LLVM repository, installs ninja, and sets | ||
# up the ccache for faster re-compilation. | ||
name: "Setup build environment (ninja, ccache, llvm, lld)" | ||
|
||
inputs: | ||
llvm-ref: | ||
llvm-version: | ||
description: | | ||
LLVM Commit Ref for checkout and build. Used for ccache value and checkout. | ||
LLVM version for checkout and build. Used for ccache value and checkout. | ||
required: true | ||
|
||
|
||
runs: | ||
# Based on https://github.com/llvm/torch-mlir/blob/main/.github/actions/setup-build/action.yml | ||
# This is a composite action - has a list of steps to execute. | ||
using: "composite" | ||
|
||
steps: | ||
# Checkout llvm at revision specified in input argument. | ||
# Checkout llvm at version specified in input argument. | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: llvm/llvm-project | ||
ref: ${{ inputs.llvm-ref }} | ||
ref: ${{ inputs.llvm-version }} | ||
path: llvm-project | ||
fetch-depth: 1 | ||
|
||
# Get ninja for cmake build. | ||
- name: Install Ninja | ||
uses: llvm/actions/install-ninja@55d844821959226fab4911f96f37071c1d4c3268 | ||
|
||
# Get LLD | ||
# Get LLD - Improves build speed on Linux | ||
- name: Install LLD | ||
if: "runner.os == 'Linux'" | ||
shell: bash | ||
run: | | ||
sudo apt-get install -y lld | ||
# Setup C++ caching using ccache. | ||
# Cache key is a combination of OS arch and LLVM ref. | ||
# Cache key is a combination of OS arch and LLVM version. | ||
- name: Ccache for C++ compilation | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: ${{ runner.os }}-stablehlo_build_assets-${{ inputs.llvm-ref }} | ||
key: ${{ runner.os }}-stablehlo_build_assets-${{ inputs.llvm-version }} | ||
max-size: 4G |
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
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