Skip to content

Commit 736abec

Browse files
authored
Cache FDB packages during the build and avoid checking them in (#3164)
This is to prevent another build from failing to produce a PR on unsuccessful merge (see #3163). It removes the debian packages from the working directory, and it also excludes `*.deb` files in the `.gitignore`, just to be sure. While I was there, I also added artifact caching so that the directory would be included in the build cache. There may not be much of a difference, given that the artifacts being downloaded are hosted on GitHub anyway, but it seemed like a good practice.
1 parent 08a785b commit 736abec

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*.jar
55
*.war
66
*.ear
7+
*.deb
78

89
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
910
hs_err_pid*

actions/setup-fdb/action.yml

+18-5
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,28 @@ inputs:
99
runs:
1010
using: "composite"
1111
steps:
12-
- name: Download FDB Client
12+
- name: Set FDB Filenames
13+
id: fdb_filenames
1314
shell: bash
14-
run: wget -nv https://github.com/apple/foundationdb/releases/download/${{ inputs.fdb_version }}/foundationdb-clients_${{ inputs.fdb_version }}-1_amd64.deb
15-
- name: Download FDB Server
15+
run: |
16+
echo "client_deb=foundationdb-clients_${{ inputs.fdb_version }}-1_amd64.deb" >> "${GITHUB_OUTPUT}"
17+
echo "server_deb=foundationdb-server_${{ inputs.fdb_version }}-1_amd64.deb" >> "${GITHUB_OUTPUT}"
18+
- name: Check FDB Binaries Cache
19+
id: cache_fdb
20+
uses: actions/cache@v3
21+
with:
22+
path: ~/.fdb-cache
23+
key: ${{ runner.os }}-fdb-debs-${{ inputs.fdb_version }}
24+
- name: Download FDB Binaries
25+
if: steps.cache_fdb.outputs.cache-hit != 'true'
1626
shell: bash
17-
run: wget -nv https://github.com/apple/foundationdb/releases/download/${{ inputs.fdb_version }}/foundationdb-server_${{ inputs.fdb_version }}-1_amd64.deb
27+
run: |
28+
mkdir -p ~/.fdb-cache
29+
wget -O ~/.fdb-cache/${{ steps.fdb_filenames.outputs.client_deb }} -nv https://github.com/apple/foundationdb/releases/download/${{ inputs.fdb_version }}/${{ steps.fdb_filenames.outputs.client_deb }}
30+
wget -O ~/.fdb-cache/${{ steps.fdb_filenames.outputs.server_deb }} -nv https://github.com/apple/foundationdb/releases/download/${{ inputs.fdb_version }}/${{ steps.fdb_filenames.outputs.server_deb }}
1831
- name: Install FDB Server
1932
shell: bash
20-
run: sudo dpkg -i foundationdb-clients_${{ inputs.fdb_version }}-1_amd64.deb foundationdb-server_${{ inputs.fdb_version }}-1_amd64.deb
33+
run: sudo dpkg -i ~/.fdb-cache/${{ steps.fdb_filenames.outputs.client_deb }} ~/.fdb-cache/${{ steps.fdb_filenames.outputs.server_deb }}
2134
- name: Fix FDB Network Addresses
2235
shell: bash
2336
run: sudo sed -i -e "s/public_address = auto:\$ID/public_address = 127.0.0.1:\$ID/g" -e "s/listen_address = public/listen_address = 0.0.0.0:\$ID/g" /etc/foundationdb/foundationdb.conf

0 commit comments

Comments
 (0)