Skip to content

Commit f945969

Browse files
committed
Do not deal with cache path as parameter for GH actions
1 parent 9079955 commit f945969

File tree

5 files changed

+4
-30
lines changed

5 files changed

+4
-30
lines changed

.github/actions/build-debian-packages/action.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
name: 'Build debian packages for Cuttlefish host'
2-
inputs:
3-
cache-path:
4-
required: true
52
runs:
63
using: "composite"
74
steps:
@@ -25,6 +22,6 @@ runs:
2522
- name: Build CF debian packages
2623
run: |
2724
sudo docker build --file "tools/buildutils/cw/Containerfile" --tag "android-cuttlefish-build" .
28-
sudo docker run -v=$PWD:/mnt/build -w /mnt/build -v=${{ inputs.cache-path }}:/root/bazel-disk-cache android-cuttlefish-build base -d /root/bazel-disk-cache
25+
sudo docker run -v=$PWD:/mnt/build -w /mnt/build -v=$HOME/bazel-disk-cache:/root/bazel-disk-cache android-cuttlefish-build base -d /root/bazel-disk-cache
2926
sudo docker run -v=$PWD:/mnt/build -w /mnt/build android-cuttlefish-build frontend
3027
shell: bash

.github/actions/mount-bazel-cache/action.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: 'Mount Bazel cache'
22
inputs:
33
action-name:
44
required: true
5-
cache-path:
6-
required: true
75
writable:
86
required: false
97
default: "false"
@@ -22,7 +20,7 @@ runs:
2220
if: inputs.writable != 'true'
2321
uses: actions/cache/restore@v4
2422
with:
25-
path: "${{ inputs.cache-path }}"
23+
path: ~/bazel-disk-cache
2624
key: ${{ format('{0}-{1}-{2}-{3}', env.CACHE_KEY_PREFIX, github.ref_name, github.sha, github.event_name) }}
2725
restore-keys: |
2826
${{ format('{0}-{1}-', env.CACHE_KEY_PREFIX, github.ref_name) }}
@@ -32,7 +30,7 @@ runs:
3230
if: inputs.writable == 'true'
3331
uses: actions/cache@v4
3432
with:
35-
path: "${{ inputs.cache-path }}"
33+
path: ~/bazel-disk-cache
3634
key: ${{ format('{0}-{1}-{2}-{3}', env.CACHE_KEY_PREFIX, github.ref_name, github.sha, github.event_name) }}
3735
restore-keys: |
3836
${{ github.event_name == 'push' && format('{0}-{1}-', env.CACHE_KEY_PREFIX, github.ref_name) || '' }}

.github/actions/run-cvd-unit-tests/action.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
name: 'Run cvd unit tests'
2-
inputs:
3-
cache-path:
4-
required: true
52
runs:
63
using: "composite"
74
steps:
@@ -18,5 +15,5 @@ runs:
1815
run: sudo tools/buildutils/installbazel.sh
1916
shell: bash
2017
- name: Run unit tests
21-
run: cd base/cvd && bazel test --disk_cache=${{ inputs.cache-path }} --sandbox_writable_path=$HOME --test_output=errors ...
18+
run: cd base/cvd && bazel test --disk_cache=$HOME/bazel-disk-cache --sandbox_writable_path=$HOME --test_output=errors ...
2219
shell: bash

.github/workflows/presubmit.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,8 @@ jobs:
170170
uses: ./.github/actions/mount-bazel-cache
171171
with:
172172
action-name: "run-cvd-unit-tests"
173-
cache-path: "$HOME/bazel-disk-cache"
174173
- name: Run cvd unit tests
175174
uses: ./.github/actions/run-cvd-unit-tests
176-
with:
177-
cache-path: "$HOME/bazel-disk-cache"
178175
- name: Upload test logs
179176
if: always()
180177
uses: actions/upload-artifact@v4
@@ -195,11 +192,8 @@ jobs:
195192
uses: ./.github/actions/mount-bazel-cache
196193
with:
197194
action-name: "build-debian-packages"
198-
cache-path: "$HOME/bazel-disk-cache"
199195
- name: Build CF host debian packages
200196
uses: ./.github/actions/build-debian-packages
201-
with:
202-
cache-path: "$HOME/bazel-disk-cache"
203197
- name: Build debs_amd64.tar
204198
run: find . -name 'cuttlefish-*.deb' -print0 | tar -cvf debs_amd64.tar --null --files-from -
205199
- name: Publish debs_amd64.tar
@@ -221,11 +215,8 @@ jobs:
221215
uses: ./.github/actions/mount-bazel-cache
222216
with:
223217
action-name: "build-debian-packages"
224-
cache-path: "$HOME/bazel-disk-cache"
225218
- name: Build CF host debian packages
226219
uses: ./.github/actions/build-debian-packages
227-
with:
228-
cache-path: "$HOME/bazel-disk-cache"
229220
- name: Build debs_arm64.tar
230221
run: find . -name 'cuttlefish-*.deb' -print0 | tar -cvf debs_arm64.tar --null --files-from -
231222
- name: Publish debs_arm64.tar

.github/workflows/update-cache-and-deployment.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,9 @@ jobs:
2323
uses: ./.github/actions/mount-bazel-cache
2424
with:
2525
action-name: "run-cvd-unit-tests"
26-
cache-path: "$HOME/bazel-disk-cache"
2726
writable: "true"
2827
- name: Run cvd unit tests
2928
uses: ./.github/actions/run-cvd-unit-tests
30-
with:
31-
cache-path: "$HOME/bazel-disk-cache"
3229
update-bazel-cache-and-deploy-debian-package-amd64:
3330
if: github.repository_owner == 'google'
3431
environment: deployment
@@ -45,12 +42,9 @@ jobs:
4542
uses: ./.github/actions/mount-bazel-cache
4643
with:
4744
action-name: "build-debian-packages"
48-
cache-path: "$HOME/bazel-disk-cache"
4945
writable: "true"
5046
- name: Build CF host debian packages
5147
uses: ./.github/actions/build-debian-packages
52-
with:
53-
cache-path: "$HOME/bazel-disk-cache"
5448
- name: Authentication on GCP project android-cuttlefish-artifacts
5549
if: github.event_name == 'push'
5650
uses: 'google-github-actions/auth@v2'
@@ -77,12 +71,9 @@ jobs:
7771
uses: ./.github/actions/mount-bazel-cache
7872
with:
7973
action-name: "build-debian-packages"
80-
cache-path: "$HOME/bazel-disk-cache"
8174
writable: "true"
8275
- name: Build CF host debian packages
8376
uses: ./.github/actions/build-debian-packages
84-
with:
85-
cache-path: "$HOME/bazel-disk-cache"
8677
- name: Authentication on GCP project android-cuttlefish-artifacts
8778
if: github.event_name == 'push'
8879
uses: 'google-github-actions/auth@v2'

0 commit comments

Comments
 (0)