-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add scripts to validate that public API has not changed
- Loading branch information
Showing
8 changed files
with
31,906 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ DerivedData/ | |
.netrc | ||
.build | ||
.mockingbird | ||
project.json | ||
project.json | ||
scripts/raw_api.json |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
script_dir=$(dirname $0) | ||
root_dir="$script_dir/../" | ||
|
||
# Generate the json file with: | ||
sourcekitten doc --module-name Confidence -- -scheme Confidence-Package -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.2' > $script_dir/raw_api.json | ||
|
||
# Extract the public API from the raw api json file | ||
python3 $script_dir/extract_public_funcs.py $script_dir/raw_api.json $script_dir/current_public_api.json | ||
|
||
# Clean up the raw api json file | ||
rm $script_dir/raw_api.json | ||
|
||
# Compare the public API with the previous public API and exit with 1 if there are changes | ||
# TODO(nicklasl): store the result (exit code) and provide information on how to remedy. | ||
git diff --no-index --exit-code $script_dir/public_api.json $script_dir/current_public_api.json |
Oops, something went wrong.