Skip to content

Commit 287ad5c

Browse files
committed
Using individual cache actions
1 parent ff02457 commit 287ad5c

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

action.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,28 @@ runs:
1717
with:
1818
repository: "Adyen/adyen-swift-public-api-diff"
1919
#ref: "0.7.0"
20-
- name: Compute binary path
20+
21+
- name: 👾 Compute binary path
2122
id: compute-path
2223
run: echo "BINARY_PATH=$(swift build --configuration release --show-bin-path)/public-api-diff" >> $GITHUB_ENV
2324
shell: bash
24-
25-
- name: Cache Swift Build
26-
uses: actions/cache@v3
25+
26+
- name: 🛻 Restore Binary
27+
uses: actions/cache/restore@v3
28+
with:
29+
path: ${{ env.BINARY_PATH }}
30+
key: build-cache-${{ runner.os }}-ENTER_VERSION_NUMBER_HERE
31+
32+
- name: 🧰 Build Swift CLI
33+
run: swift build --configuration release
34+
35+
- name: 💾 Save Binary
36+
uses: actions/cache/save@v3
2737
with:
2838
path: ${{ env.BINARY_PATH }}
29-
key: ${{ runner.os }}-swift-build-6ec5ba25648323a388a756636e7f668b04d9f615
30-
#key: ${{ runner.os }}-swift-build-${{ github.sha }}
31-
- name: "Run Diff"
39+
key: build-cache-${{ runner.os }}-ENTER_VERSION_NUMBER_HERE
40+
41+
- name: 🏃 Run Diff
3242
run: |
3343
NEW=${{ inputs.new }}
3444
OLD=${{ inputs.old }}
@@ -40,15 +50,7 @@ runs:
4050
4151
# Check if the binary exists
4252
if [ ! -f $BINARY_PATH ]; then
43-
44-
echo "📭 Binary not found at $BINARY_PATH. Building the project..."
45-
swift build --configuration release
46-
47-
# Check if the build was successful
48-
if [ ! -f "$BINARY_PATH" ]; then
49-
echo "Build failed"
50-
exit 1
51-
fi
53+
echo "📭 Binary not found at $BINARY_PATH. Exiting..."
5254
else
5355
echo "📬 Binary found at $BINARY_PATH"
5456
fi

0 commit comments

Comments
 (0)