2022-04-04 18:13:29 +08:00
|
|
|
name: "Setup build environment"
|
|
|
|
description: "Setup the build environment. An action so that it can be shared between in-tree/out-of-tree jobs"
|
|
|
|
|
2022-04-13 21:26:38 +08:00
|
|
|
inputs:
|
2022-04-13 23:48:04 +08:00
|
|
|
cache-suffix:
|
2022-04-13 21:26:38 +08:00
|
|
|
description: |
|
|
|
|
Additional string that is used to compute the ccache hash.
|
|
|
|
Different jobs running the action need distinct values for this key,
|
|
|
|
but the content is irrelevant.
|
|
|
|
required: true
|
|
|
|
|
2022-04-04 18:13:29 +08:00
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.9
|
|
|
|
- name: Install MLIR Python depends
|
|
|
|
run: |
|
|
|
|
python -m pip install -r $GITHUB_WORKSPACE/externals/llvm-project/mlir/python/requirements.txt
|
|
|
|
shell: bash
|
|
|
|
- name: Install PyTorch nightly depends
|
|
|
|
run: |
|
|
|
|
python -m pip install -r requirements.txt
|
|
|
|
shell: bash
|
|
|
|
- name: Install Ninja
|
|
|
|
uses: llvm/actions/install-ninja@55d844821959226fab4911f96f37071c1d4c3268
|
|
|
|
- name: Get Submodule Hash
|
|
|
|
id: get-submodule-hash
|
|
|
|
run: echo "::set-output name=hash::$(md5sum $(git submodule status))"
|
|
|
|
shell: bash
|
|
|
|
- name: Ccache for C++ compilation
|
|
|
|
uses: hendrikmuhs/ccache-action@4687d037e4d7cf725512d9b819137a3af34d39b3
|
|
|
|
with:
|
2022-04-13 23:48:04 +08:00
|
|
|
key: ${{ runner.os }}-clangreleaseasserts-${{ steps.get-submodule-hash.outputs.hash }}${{ inputs.cache-suffix }}
|