-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctly select implementations to run via CI (#117)
- **Also run implementations changed in a PR** - **Fix ignoring runs on GitHub Actions** - **Adjust Makefile timeout based on runs** - **Skip cache for implementations modified by PRs**
- Loading branch information
1 parent
544faa5
commit 3ce137f
Showing
3 changed files
with
32 additions
and
9 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# Get a list of all implementations (with some potentially ignored) | ||
all_impls=$(make NO_IGNORE=$NO_IGNORE list | sort) | ||
|
||
# Add implementations changed in the PR | ||
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then | ||
git fetch origin $GITHUB_BASE_REF --depth 1 | ||
pr_impls=$(git diff --name-only FETCH_HEAD..HEAD | grep '^implementations/' | cut -d/ -f2 | sort -u) | ||
fi | ||
|
||
# Get all implementations that are modified by the PR | ||
base_impls=$(comm -23 <(echo "$all_impls") <(echo "$pr_impls")) | ||
|
||
# Format as JSON like {"include": [{"impl" "foo"}, ...]} | ||
echo -n '{"include":[' | ||
(echo "$base_impls" | while read impl; do | ||
echo -n '{"impl": "'$impl'", "skip_cache": false},' | ||
done | ||
echo "$pr_impls" | while read impl; do | ||
[ -z "$impl" ] || echo -n '{"impl": "'$impl'", "skip_cache": true},' | ||
done) | sed 's/,$//' # Remove trailing comma | ||
echo "]}" |
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