-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
CI Builds: Conditional builds with path filtering #9787
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 hidden or 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,74 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
codecov: codecov/[email protected] | ||
|
||
jobs: | ||
tests: | ||
docker: | ||
- image: 'cimg/python:3.10' | ||
environment: | ||
TOX_POSARGS: '' | ||
- image: 'docker.elastic.co/elasticsearch/elasticsearch:7.14.0' | ||
name: search | ||
environment: | ||
discovery.type: single-node | ||
ES_JAVA_OPTS: -Xms750m -Xmx750m | ||
steps: | ||
- when: | ||
condition: build-code | ||
steps: | ||
- checkout | ||
- run: git submodule sync | ||
- run: git submodule update --init | ||
- run: pip install --user 'tox<5' | ||
- run: tox -e py310 | ||
- codecov/upload | ||
|
||
tests-embedapi: | ||
docker: | ||
- image: 'cimg/python:3.10' | ||
steps: | ||
- when: | ||
condition: build-code | ||
steps: | ||
- checkout | ||
- run: git submodule sync | ||
- run: git submodule update --init | ||
- run: pip install --user 'tox<4' | ||
- run: tox -c tox.embedapi.ini | ||
|
||
checks: | ||
docker: | ||
- image: 'cimg/python:3.10' | ||
environment: | ||
NODE_VERSION: 10.17.0 | ||
# This could also be done more conditionally like the former tests | ||
steps: | ||
- checkout | ||
- run: git submodule sync | ||
- run: git submodule update --init | ||
- run: git fetch origin main # needed for comparisson in pre-commit | ||
- run: git branch -f --track main origin/main # needed for comparisson in pre-commit | ||
- run: pip install --user 'tox<5' | ||
- run: tox -e migrations | ||
- run: tox -e pre-commit | ||
- run: tox -e lint | ||
- run: scripts/circle/install_node.sh | ||
- run: | ||
name: Add node to the path | ||
command: | | ||
echo 'export PATH=~/.nvm/versions/node/v${NODE_VERSION}/bin:$PATH' >> $BASH_ENV | ||
source $BASH_ENV | ||
- run: tox -e eslint | ||
|
||
workflows: | ||
version: 2 | ||
test: | ||
jobs: | ||
- checks | ||
- tests | ||
- tests-embedapi: | ||
requires: | ||
- checks | ||
- tests |
This file contains hidden or 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 |
---|---|---|
@@ -1,67 +1,19 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
codecov: codecov/[email protected] | ||
|
||
jobs: | ||
tests: | ||
docker: | ||
- image: 'cimg/python:3.10' | ||
environment: | ||
TOX_POSARGS: '' | ||
- image: 'docker.elastic.co/elasticsearch/elasticsearch:7.14.0' | ||
name: search | ||
environment: | ||
discovery.type: single-node | ||
ES_JAVA_OPTS: -Xms750m -Xmx750m | ||
steps: | ||
- checkout | ||
- run: git submodule sync | ||
- run: git submodule update --init | ||
- run: pip install --user 'tox<5' | ||
- run: tox -e py310 | ||
- codecov/upload | ||
setup: true | ||
|
||
tests-embedapi: | ||
docker: | ||
- image: 'cimg/python:3.10' | ||
steps: | ||
- checkout | ||
- run: git submodule sync | ||
- run: git submodule update --init | ||
- run: pip install --user 'tox<4' | ||
- run: tox -c tox.embedapi.ini | ||
|
||
checks: | ||
docker: | ||
- image: 'cimg/python:3.10' | ||
environment: | ||
NODE_VERSION: 10.17.0 | ||
steps: | ||
- checkout | ||
- run: git submodule sync | ||
- run: git submodule update --init | ||
- run: git fetch origin main # needed for comparisson in pre-commit | ||
- run: git branch -f --track main origin/main # needed for comparisson in pre-commit | ||
- run: pip install --user 'tox<5' | ||
- run: tox -e pre-commit | ||
- run: tox -e migrations | ||
- run: tox -e lint | ||
- run: scripts/circle/install_node.sh | ||
- run: | ||
name: Add node to the path | ||
command: | | ||
echo 'export PATH=~/.nvm/versions/node/v${NODE_VERSION}/bin:$PATH' >> $BASH_ENV | ||
source $BASH_ENV | ||
- run: tox -e eslint | ||
orbs: | ||
path-filtering: circleci/[email protected] | ||
|
||
workflows: | ||
version: 2 | ||
test: | ||
generate-config: | ||
jobs: | ||
- checks | ||
- tests | ||
- tests-embedapi: | ||
requires: | ||
- checks | ||
- tests | ||
- path-filtering/filter: | ||
base-revision: main | ||
config-path: .circleci/config-conditional-builds.yml | ||
mapping: | | ||
requirements/.* build-code true | ||
readthedocs/.* build-code true | ||
pytest.* build-code true | ||
tox.* build-code true | ||
package.* build-code true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are essential bits to adjust. We want to run this stuff whenever something essential is changed. 2 considerations that we might have for later:
|
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.
When we target branches different from
main
, there might be some false positives. I've opened up a feature request: CircleCI-Public/path-filtering-orb#65