-
Notifications
You must be signed in to change notification settings - Fork 15.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci matrix #14306
Merged
Merged
ci matrix #14306
Changes from 13 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
7dcc3c9
wip
baskaryan d3c3b3f
nit
baskaryan 6d003fb
nit
baskaryan bb66190
nit
baskaryan 018ebfb
nit
baskaryan d5c840e
nit
baskaryan ce86cca
nit
baskaryan 04e036f
json
baskaryan 8b6712d
debug
baskaryan 2767277
path
baskaryan 9efa93b
actions
baskaryan 2e928b8
actions
baskaryan 4aad904
concurrency
baskaryan 2ae61b5
more
baskaryan 27ec037
nit
baskaryan 69df6b9
working-dir
baskaryan 7e1e2d2
try
baskaryan 854be67
if
baskaryan f6be47b
syntax
baskaryan df024a4
single
baskaryan b951119
cr
baskaryan 776bb0b
cr
baskaryan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,27 @@ | ||
import json | ||
import sys | ||
|
||
ALL_DIRS = { | ||
"libs/core", | ||
"libs/community", | ||
"libs/langchain", | ||
"libs/experimental", | ||
"libs/partners/openai", | ||
} | ||
|
||
if __name__ == "__main__": | ||
files = sys.argv[1:] | ||
dirs_to_run = set() | ||
|
||
for file in files: | ||
if any(dir_ in file for dir_ in (".github/workflows", ".github/tools", ".github/actions", "libs/core")): | ||
dirs_to_run = ALL_DIRS | ||
break | ||
elif "libs/community" in file: | ||
dirs_to_run.update(("libs/community", "libs/langchain", "libs/experimental")) | ||
elif "libs/partners" in file: | ||
baskaryan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
partner_dir = file.split("/")[2] | ||
dirs_to_run.add(f"libs/partners/{partner_dir}") | ||
else: | ||
pass | ||
print(json.dumps(list(dirs_to_run))) |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
name: Check library diffs | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
paths: | ||
- ".github/actions/**" | ||
- ".github/tools/**" | ||
- ".github/workflows/**" | ||
- "libs/**" | ||
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI | ||
|
||
# If another push to the same PR or branch happens while this workflow is still running, | ||
# cancel the earlier run in favor of the next run. | ||
# | ||
# There's no point in testing an outdated version of the code. GitHub only allows | ||
# a limited number of job runners to be active at the same time, so it's better to cancel | ||
# pointless jobs early so that more useful jobs can run sooner. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- id: files | ||
uses: Ana06/[email protected] | ||
baskaryan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- run: | | ||
for changed_file in ${{ steps.files.outputs.all }}; do | ||
baskaryan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
echo "Do something with this ${changed_file}." | ||
done | ||
- id: set-matrix | ||
run: echo "dirs-to-run=$(python .github/scripts/check_diff.py ${{ steps.files.outputs.all }})" >> $GITHUB_OUTPUT | ||
outputs: | ||
dirs-to-run: ${{ steps.set-matrix.outputs.dirs-to-run }} | ||
ci: | ||
needs: [ build ] | ||
strategy: | ||
matrix: | ||
working-directory: ${{ fromJson(needs.build.outputs.dirs-to-run) }} | ||
baskaryan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
uses: ./.github/workflows/_all_ci.yml | ||
with: | ||
working-directory: ${{ matrix.working-directory }} | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be better to make this a negative case just in case we introduce some new folder structure in the future, probably want to run too much rather than too little CI