Skip to content

Commit 6a41c5c

Browse files
committed
Add dep build caching to other workflows
1 parent 2ad4a87 commit 6a41c5c

File tree

4 files changed

+72
-0
lines changed

4 files changed

+72
-0
lines changed

.github/workflows/build-linux-debug.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,31 @@ jobs:
6161
shell: bash -l {0}
6262
run: .github/workflows/gha_conda.sh
6363

64+
- name: Restore Dependencies Cache
65+
id: cache-deps-restore
66+
uses: actions/cache/restore@v3
67+
with:
68+
path: $HOME/install
69+
key: ${{ runner.os }}-deps-${{ hashFiles('.github/workflows/gha_deps.sh', 'install_shapeworks.sh', 'python_requirements.txt', 'build_dependencies.sh') }}
70+
restore-keys: |
71+
${{ runner.os }}-deps-
72+
6473
- name: Check space4
6574
run: df -h
6675

76+
6777
- name: Build Dependencies
78+
if: steps.cache-deps-restore.outputs.cache-hit != 'true'
6879
shell: bash -l {0}
6980
run: .github/workflows/gha_deps.sh
7081

82+
- name: Save Dependencies Cache
83+
if: steps.cache-deps-restore.outputs.cache-hit != 'true' && always()
84+
uses: actions/cache/save@v3
85+
with:
86+
path: $HOME/install
87+
key: ${{ runner.os }}-deps-${{ hashFiles('.github/workflows/gha_deps.sh', 'install_shapeworks.sh', 'python_requirements.txt', 'build_dependencies.sh') }}
88+
7189
- name: Check space5
7290
run: df -h
7391

.github/workflows/build-linux.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,32 @@ jobs:
5959
shell: bash -l {0}
6060
run: .github/workflows/gha_conda.sh
6161

62+
- name: Restore Dependencies Cache
63+
id: cache-deps-restore
64+
uses: actions/cache/restore@v3
65+
with:
66+
path: $HOME/install
67+
key: ${{ runner.os }}-deps-${{ hashFiles('.github/workflows/gha_deps.sh', 'install_shapeworks.sh', 'python_requirements.txt', 'build_dependencies.sh') }}
68+
restore-keys: |
69+
${{ runner.os }}-deps-
70+
6271
- name: try import vtk
6372
shell: bash -l {0}
6473
run: conda activate shapeworks && python -c "import vtk"
6574

75+
6676
- name: Build Dependencies
77+
if: steps.cache-deps-restore.outputs.cache-hit != 'true'
6778
shell: bash -l {0}
6879
run: .github/workflows/gha_deps.sh
6980

81+
- name: Save Dependencies Cache
82+
if: steps.cache-deps-restore.outputs.cache-hit != 'true' && always()
83+
uses: actions/cache/save@v3
84+
with:
85+
path: $HOME/install
86+
key: ${{ runner.os }}-deps-${{ hashFiles('.github/workflows/gha_deps.sh', 'install_shapeworks.sh', 'python_requirements.txt', 'build_dependencies.sh') }}
87+
7088
- name: Check space4
7189
run: df -h
7290

.github/workflows/build-mac-arm64.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,28 @@ jobs:
5050
shell: bash -l {0}
5151
run: .github/workflows/gha_conda.sh
5252

53+
- name: Restore Dependencies Cache
54+
id: cache-deps-restore
55+
uses: actions/cache/restore@v3
56+
with:
57+
path: $HOME/install
58+
key: ${{ runner.os }}-deps-${{ hashFiles('.github/workflows/gha_deps.sh', 'install_shapeworks.sh', 'python_requirements.txt', 'build_dependencies.sh') }}
59+
restore-keys: |
60+
${{ runner.os }}-deps-
61+
62+
5363
- name: Build Dependencies
64+
if: steps.cache-deps-restore.outputs.cache-hit != 'true'
5465
shell: bash -l {0}
5566
run: .github/workflows/gha_deps.sh
5667

68+
- name: Save Dependencies Cache
69+
if: steps.cache-deps-restore.outputs.cache-hit != 'true' && always()
70+
uses: actions/cache/save@v3
71+
with:
72+
path: $HOME/install
73+
key: ${{ runner.os }}-deps-${{ hashFiles('.github/workflows/gha_deps.sh', 'install_shapeworks.sh', 'python_requirements.txt', 'build_dependencies.sh') }}
74+
5775
- name: cmake
5876
shell: bash -l {0}
5977
run: conda activate shapeworks && mkdir build && cd build && cmake -DCMAKE_LIBTOOL=/usr/bin/libtool -DCMAKE_CXX_FLAGS="-g -Wno-enum-constexpr-conversion" -DCMAKE_PREFIX_PATH=$HOME/install -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPython3_ROOT_DIR:FILEPATH=${CONDA_PREFIX} -DUSE_OPENMP=OFF -DBuild_Studio=ON -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/shapeworks-install -DBUILD_DOCUMENTATION=ON -DGA_MEASUREMENT_ID=$GA_MEASUREMENT_ID -DGA_API_SECRET=$GA_API_SECRET ..

.github/workflows/build-mac.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,28 @@ jobs:
5151
shell: bash -l {0}
5252
run: .github/workflows/gha_conda.sh
5353

54+
- name: Restore Dependencies Cache
55+
id: cache-deps-restore
56+
uses: actions/cache/restore@v3
57+
with:
58+
path: $HOME/install
59+
key: ${{ runner.os }}-deps-${{ hashFiles('.github/workflows/gha_deps.sh', 'install_shapeworks.sh', 'python_requirements.txt', 'build_dependencies.sh') }}
60+
restore-keys: |
61+
${{ runner.os }}-deps-
62+
63+
5464
- name: Build Dependencies
65+
if: steps.cache-deps-restore.outputs.cache-hit != 'true'
5566
shell: bash -l {0}
5667
run: .github/workflows/gha_deps.sh
5768

69+
- name: Save Dependencies Cache
70+
if: steps.cache-deps-restore.outputs.cache-hit != 'true' && always()
71+
uses: actions/cache/save@v3
72+
with:
73+
path: $HOME/install
74+
key: ${{ runner.os }}-deps-${{ hashFiles('.github/workflows/gha_deps.sh', 'install_shapeworks.sh', 'python_requirements.txt', 'build_dependencies.sh') }}
75+
5876
- name: cmake
5977
shell: bash -l {0}
6078
run: conda activate shapeworks && mkdir build && cd build && cmake -DCMAKE_LIBTOOL=/usr/bin/libtool -DCMAKE_CXX_FLAGS=-g -DCMAKE_PREFIX_PATH=$HOME/install -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPython3_ROOT_DIR:FILEPATH=${CONDA_PREFIX} -DUSE_OPENMP=OFF -DBuild_Studio=ON -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/shapeworks-install -DBUILD_DOCUMENTATION=ON -DGA_MEASUREMENT_ID=$GA_MEASUREMENT_ID -DGA_API_SECRET=$GA_API_SECRET ..

0 commit comments

Comments
 (0)