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 1616 - uses : actions/checkout@v4
1717 with :
1818 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 }}
2026 - name : " Run Diff"
2127 run : |
2228 NEW=${{ inputs.new }}
2531 PROJECT_FOLDER=$PWD
2632 echo $PROJECT_FOLDER
2733
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"
2953 cat "$PROJECT_FOLDER/logs.txt"
3054
3155 cat "$PROJECT_FOLDER/api_comparison.md" >> $GITHUB_STEP_SUMMARY
You can’t perform that action at this time.
0 commit comments