-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: updated pipeline to filter src, tests and tests_aws folders
Signed-off-by: Cagri Yonca <[email protected]>
- Loading branch information
1 parent
e1b8d7c
commit 598dd38
Showing
1 changed file
with
110 additions
and
10 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 |
---|---|---|
|
@@ -5,6 +5,29 @@ version: 2.1 | |
# ruby: circleci/[email protected] | ||
|
||
commands: | ||
check-if-tests-needed: | ||
steps: | ||
- run: | ||
name: Check if tests need to run | ||
command: | | ||
# If we're on main branch, always run tests | ||
if [ "${CIRCLE_BRANCH}" = "main" ]; then | ||
echo "On main branch - running all tests" | ||
exit 0 | ||
fi | ||
# Fetch all the branches | ||
git fetch origin | ||
# Get list of changed files between current branch and main | ||
CHANGED_FILES=$(git diff --name-only origin/main...HEAD) | ||
# Check if any relevant files changed | ||
echo "$CHANGED_FILES" | grep -q -E "^(src/|tests/|tests_aws/)" || { | ||
echo "No changes in src/, tests/, or tests_aws/ directories. Skipping tests." | ||
circleci step halt | ||
} | ||
pip-install-deps: | ||
parameters: | ||
requirements: | ||
|
@@ -116,6 +139,7 @@ jobs: | |
working_directory: ~/repo | ||
steps: | ||
- checkout | ||
- check-if-tests-needed | ||
- pip-install-deps | ||
- run-tests-with-coverage-report | ||
- store-pytest-results | ||
|
@@ -143,6 +167,7 @@ jobs: | |
working_directory: ~/repo | ||
steps: | ||
- checkout | ||
- check-if-tests-needed | ||
- pip-install-deps | ||
- run-tests-with-coverage-report | ||
- store-pytest-results | ||
|
@@ -170,6 +195,7 @@ jobs: | |
working_directory: ~/repo | ||
steps: | ||
- checkout | ||
- check-if-tests-needed | ||
- pip-install-deps: | ||
requirements: "tests/requirements.txt" | ||
- run-tests-with-coverage-report | ||
|
@@ -198,6 +224,7 @@ jobs: | |
working_directory: ~/repo | ||
steps: | ||
- checkout | ||
- check-if-tests-needed | ||
- pip-install-deps: | ||
requirements: "tests/requirements.txt" | ||
- run-tests-with-coverage-report | ||
|
@@ -226,6 +253,7 @@ jobs: | |
working_directory: ~/repo | ||
steps: | ||
- checkout | ||
- check-if-tests-needed | ||
- pip-install-deps: | ||
requirements: "tests/requirements.txt" | ||
- run-tests-with-coverage-report | ||
|
@@ -238,6 +266,7 @@ jobs: | |
working_directory: ~/repo | ||
steps: | ||
- checkout | ||
- check-if-tests-needed | ||
- pip-install-deps: | ||
requirements: "tests/requirements.txt" | ||
- run-tests-with-coverage-report: | ||
|
@@ -267,6 +296,7 @@ jobs: | |
working_directory: ~/repo | ||
steps: | ||
- checkout | ||
- check-if-tests-needed | ||
- pip-install-deps: | ||
requirements: "tests/requirements.txt" | ||
- run-tests-with-coverage-report | ||
|
@@ -295,6 +325,7 @@ jobs: | |
working_directory: ~/repo | ||
steps: | ||
- checkout | ||
- check-if-tests-needed | ||
- pip-install-deps: | ||
requirements: "tests/requirements-pre314.txt" | ||
- run-tests-with-coverage-report | ||
|
@@ -311,6 +342,7 @@ jobs: | |
working_directory: ~/repo | ||
steps: | ||
- checkout | ||
- check-if-tests-needed | ||
- pip-install-deps: | ||
requirements: "tests/requirements-cassandra.txt" | ||
- run-tests-with-coverage-report: | ||
|
@@ -325,6 +357,7 @@ jobs: | |
working_directory: ~/repo | ||
steps: | ||
- checkout | ||
- check-if-tests-needed | ||
- pip-install-deps: | ||
requirements: "tests/requirements.txt" | ||
- store-pytest-results | ||
|
@@ -336,6 +369,7 @@ jobs: | |
working_directory: ~/repo | ||
steps: | ||
- checkout | ||
- check-if-tests-needed | ||
- pip-install-deps: | ||
requirements: "tests/requirements-gevent-starlette.txt" | ||
- run-tests-with-coverage-report: | ||
|
@@ -350,16 +384,76 @@ workflows: | |
version: 2 | ||
build: | ||
jobs: | ||
- python38 | ||
- python39 | ||
- python310 | ||
- python311 | ||
- python312 | ||
- python313 | ||
- python314 | ||
- py39cassandra | ||
- py39gevent_starlette | ||
- py312aws | ||
- python38: | ||
filters: | ||
branches: | ||
only: /.*/ | ||
ignore: [] | ||
tags: | ||
only: /.*/ | ||
- python39: | ||
filters: | ||
branches: | ||
only: /.*/ | ||
ignore: [] | ||
tags: | ||
only: /.*/ | ||
- python310: | ||
filters: | ||
branches: | ||
only: /.*/ | ||
ignore: [] | ||
tags: | ||
only: /.*/ | ||
- python311: | ||
filters: | ||
branches: | ||
only: /.*/ | ||
ignore: [] | ||
tags: | ||
only: /.*/ | ||
- python312: | ||
filters: | ||
branches: | ||
only: /.*/ | ||
ignore: [] | ||
tags: | ||
only: /.*/ | ||
- python313: | ||
filters: | ||
branches: | ||
only: /.*/ | ||
ignore: [] | ||
tags: | ||
only: /.*/ | ||
- python314: | ||
filters: | ||
branches: | ||
only: /.*/ | ||
ignore: [] | ||
tags: | ||
only: /.*/ | ||
- py39cassandra: | ||
filters: | ||
branches: | ||
only: /.*/ | ||
ignore: [] | ||
tags: | ||
only: /.*/ | ||
- py39gevent_starlette: | ||
filters: | ||
branches: | ||
only: /.*/ | ||
ignore: [] | ||
tags: | ||
only: /.*/ | ||
- py312aws: | ||
filters: | ||
branches: | ||
only: /.*/ | ||
ignore: [] | ||
tags: | ||
only: /.*/ | ||
- final_job: | ||
requires: | ||
- python38 | ||
|
@@ -373,3 +467,9 @@ workflows: | |
- py39cassandra | ||
- py39gevent_starlette | ||
- py312aws | ||
filters: | ||
branches: | ||
only: /.*/ | ||
ignore: [] | ||
tags: | ||
only: /.*/ |