File tree Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 16
16
- uses : actions/checkout@v4
17
17
with :
18
18
repository : " Adyen/adyen-swift-public-api-diff"
19
- ref : " 0.7.0"
19
+ # ref: "0.7.0"
20
+ - name : Cache Swift Build
21
+ uses : actions/cache@v3
22
+ with :
23
+ path : |
24
+ $(swift build --configuration release --show-bin-path)
25
+ key : ${{ runner.os }}-swift-build-${{ github.sha }}
20
26
- name : " Run Diff"
21
27
run : |
22
28
NEW=${{ inputs.new }}
25
31
PROJECT_FOLDER=$PWD
26
32
echo $PROJECT_FOLDER
27
33
28
- swift run public-api-diff project --new "$NEW" --old "$OLD" --platform "$PLATFORM" --output "$PROJECT_FOLDER/api_comparison.md" --log-output "$PROJECT_FOLDER/logs.txt"
34
+ # Build the Swift project in release configuration and get the binary path
35
+ BINARY_DIR_PATH=$(swift build --configuration release --show-bin-path)
36
+ BINARY_PATH="$BINARY_DIR_PATH/public-api-diff"
37
+
38
+ # Check if the binary exists
39
+ if [ ! -f "$BINARY" ]; then
40
+ echo "Binary not found. Building the project..."
41
+ swift build --configuration release
42
+ # Check if the build was successful
43
+ if [ $? -ne 0 ]; then
44
+ echo "Build failed"
45
+ exit 1
46
+ fi
47
+ else
48
+ echo "Binary found at $BINARY_PATH"
49
+ fi
50
+
51
+ # Run the binary $BINARY
52
+ $BINARY_PATH project --new "$NEW" --old "$OLD" --platform "$PLATFORM" --output "$PROJECT_FOLDER/api_comparison.md" --log-output "$PROJECT_FOLDER/logs.txt"
29
53
cat "$PROJECT_FOLDER/logs.txt"
30
54
31
55
cat "$PROJECT_FOLDER/api_comparison.md" >> $GITHUB_STEP_SUMMARY
You can’t perform that action at this time.
0 commit comments