From b711e0991de9590a5417039eb8c81fea54a221b8 Mon Sep 17 00:00:00 2001 From: Hans Date: Sun, 2 Jun 2024 18:13:30 +0800 Subject: [PATCH] ci: ignore build if cached --- .github/workflows/ci.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e687e1c..32c39b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: uses: actions/cache@v2 with: path: executorch/cmake-out - key: ${{ runner.os }}-cmake-${{ hashFiles('executorch/CMakeLists.txt') }} + key: ${{ runner.os }}-cmake-${{ hashFiles('executorch/kernels/*.cpp') }}-${{ hashFiles('executorch/extension/*.cpp') }}-${{ hashFiles('executorch/backends/*.cpp') }}-${{ hashFiles('executorch/runtime/*.cpp') }} - name: Build executorch run: | python -m venv .venv @@ -37,15 +37,17 @@ jobs: cd executorch pip install tomli zstd setuptools wheel pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu - ./install_requirements.sh - cmake \ - -S . \ - -B cmake-out \ - -DCMAKE_INSTALL_PREFIX=cmake-out \ - -DEXECUTORCH_BUILD_XNNPACK=ON \ - -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \ - -DEXECUTORCH_BUILD_EXTENSION_MODULE=ON - cmake --build cmake-out --target install --config Release + if [ ! -d cmake-out ]; then + ./install_requirements.sh + cmake \ + -S . \ + -B cmake-out \ + -DCMAKE_INSTALL_PREFIX=cmake-out \ + -DEXECUTORCH_BUILD_XNNPACK=ON \ + -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \ + -DEXECUTORCH_BUILD_EXTENSION_MODULE=ON + cmake --build cmake-out --target install --config Release + fi - name: Install dependencies run: yarn install - name: Build