torch-mlir/.github/actions/setup-build/action.yml

38 lines
1.3 KiB
YAML

name: "Setup build environment"
description: "Setup the build environment. An action so that it can be shared between in-tree/out-of-tree jobs"
inputs:
cache-suffix:
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
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@85bd285251b831e5a761d26e3dbfdbccbca1b23f
with:
key: ${{ runner.os }}-clangreleaseasserts-${{ steps.get-submodule-hash.outputs.hash }}${{ inputs.cache-suffix }}
max-size: 2G