Pin actions/cache/{restore,save}
actions
#4578
Workflow file for this run
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
# yamllint disable rule:line-length | |
name: CI | |
on: | |
workflow_dispatch: | |
workflow_call: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
concurrency: | |
# A PR number if a pull request and otherwise the commit hash. This cancels | |
# queued and in-progress runs for the same PR (presubmit) or commit | |
# (postsubmit). | |
group: ci-build-test-cpp-linux-${{ github.event.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
build-test-linux: | |
strategy: | |
fail-fast: true | |
matrix: | |
torch-version: [nightly, stable] | |
name: Build and Test (Linux, torch-${{ matrix.torch-version }}, assertions) | |
runs-on: torch-mlir-cpubuilder-linux-x86-64-scale | |
env: | |
CACHE_DIR: ${{ github.workspace }}/.container-cache | |
steps: | |
- name: "Checking out repository" | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
submodules: true | |
- name: Enable cache | |
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
with: | |
path: ${{ env.CACHE_DIR }} | |
key: build-test-cpp-asserts-manylinux-${{ matrix.torch-version }}-v2-${{ github.sha }} | |
restore-keys: | | |
build-test-cpp-asserts-manylinux-${{ matrix.torch-version }}-v2- | |
- name: "Setting up Python" | |
run: | | |
sudo apt update | |
sudo apt install software-properties-common -y | |
sudo add-apt-repository ppa:deadsnakes/ppa -y | |
sudo apt install python3.11 python3-pip -y | |
sudo apt-get install python3.11-dev python3.11-venv build-essential -y | |
- name: Install python deps (torch-${{ matrix.torch-version }}) | |
run: | | |
export cache_dir="${{ env.CACHE_DIR }}" | |
bash build_tools/ci/install_python_deps.sh ${{ matrix.torch-version }} | |
- name: ccache | |
uses: hendrikmuhs/ccache-action@53911442209d5c18de8a31615e0923161e435875 # v1.2.16 | |
with: | |
key: ${{ github.job }}-${{ matrix.torch-version }} | |
save: ${{ needs.setup.outputs.write-caches == 1 }} | |
- name: Build project | |
run: | | |
export cache_dir="${{ env.CACHE_DIR }}" | |
bash build_tools/ci/build_posix.sh | |
- name: Save cache | |
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
if: ${{ !cancelled() }} | |
with: | |
path: ${{ env.CACHE_DIR }} | |
key: build-test-cpp-asserts-manylinux-${{ matrix.torch-version }}-v2-${{ github.sha }} | |
- name: Integration tests (torch-${{ matrix.torch-version }}) | |
run: | | |
bash build_tools/ci/test_posix.sh ${{ matrix.torch-version }} | |
- name: Check generated sources (torch-nightly only) | |
if: ${{ matrix.torch-version == 'nightly' }} | |
run: | | |
bash build_tools/ci/check_generated_sources.sh |