Skip to content

Commit

Permalink
wip: implement dynamic CircleCI config with path-filtering
Browse files Browse the repository at this point in the history
 - Updated root .circleci/config.yml to include path-filtering orb
 - Added continuation steps for dynamically processing package-specific configs
 - Marked package-specific config.yml files as version 2.1 for compatibility
 - Adjusted workflows to trigger on changes to specific package paths
 - Testing and validation of dynamic CI configuration in progress
  • Loading branch information
abdelhamid-f-nasser committed Feb 14, 2024
1 parent a698d3a commit f7fad8a
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 13 deletions.
15 changes: 15 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2.1

# this allows you to use CircleCI's dynamic configuration feature
setup: true

orbs:
path-filtering: circleci/[email protected]

workflows:
setup:
jobs:
- path-filtering/filter:
name: filter_instabug_flutter
config-path: packages/instabug_flutter/.circleci/config.yml
base-revision: master
2 changes: 2 additions & 0 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ packages:
scripts:
analyze:
exec: dart analyze .
format:
exec: dart format . --set-exit-if-changed
pigeon:
exec: sh scripts/pigeon.sh
packageFilters:
Expand Down
7 changes: 3 additions & 4 deletions packages/Instabug_Dart_http_Adapter/.circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 2
version: 2.1
jobs:
test:
docker:
Expand All @@ -17,10 +17,9 @@ jobs:
steps:
- checkout
- run: chmod +x release.sh
- run: ./release.sh
- run: ./release.sh

workflows:
version: 2
build-test:
jobs:
- test
Expand All @@ -36,4 +35,4 @@ workflows:
- hold
filters:
branches:
only: master
only: master
5 changes: 2 additions & 3 deletions packages/instabug_dio_interceptor/.circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 2
version: 2.1
jobs:
test:
docker:
Expand All @@ -11,7 +11,7 @@ jobs:
- run: flutter test
- run: flutter analyze .
- run: flutter pub publish --dry-run

release:
docker:
- image: cirrusci/flutter
Expand All @@ -20,7 +20,6 @@ jobs:
- run: ./release.sh

workflows:
version: 2
build-test:
jobs:
- test
Expand Down
16 changes: 11 additions & 5 deletions packages/instabug_flutter/.circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ commands:
version: 3.10.5
- run:
name: Generate Pigeons
command: sh ./scripts/pigeon.sh
command: sh ./packages/instabug_flutter/scripts/pigeon.sh
setup_ios:
steps:
# Flutter doesn't support Apple Silicon yet, so we need to install Rosetta use Flutter on M1 machines.
Expand Down Expand Up @@ -120,6 +120,7 @@ jobs:
command: yarn danger ci

test_flutter:
working_directory: packages/instabug_flutter
parameters:
version:
type: string
Expand All @@ -139,6 +140,7 @@ jobs:
- lcov.info

test_android:
working_directory: packages/instabug_flutter
executor:
name: android/android-machine
resource-class: xlarge
Expand All @@ -157,6 +159,7 @@ jobs:
test-command: ./gradlew test

e2e_android_captain:
working_directory: packages/instabug_flutter
executor:
name: android/android-machine
resource-class: xlarge
Expand All @@ -173,6 +176,7 @@ jobs:
test-command: cd e2e || true && dotnet test

test_ios:
working_directory: packages/instabug_flutter
macos:
xcode: 13.4.1
resource_class: macos.m1.medium.gen1
Expand Down Expand Up @@ -210,6 +214,7 @@ jobs:
command: dotnet test

format_flutter:
working_directory: packages/instabug_flutter
docker:
- image: cirrusci/flutter
steps:
Expand All @@ -221,6 +226,7 @@ jobs:
command: dart format . --set-exit-if-changed

lint_flutter:
working_directory: packages/instabug_flutter
docker:
- image: cirrusci/flutter
steps:
Expand All @@ -232,6 +238,7 @@ jobs:
command: flutter analyze

verify_pub:
working_directory: packages/instabug_flutter
docker:
- image: cirrusci/flutter
steps:
Expand All @@ -256,11 +263,11 @@ jobs:
app-dir: project
- run:
name: Install pub packages
working_directory: ~/project
working_directory: ~/project/packages/instabug_flutter
command: dart pub get
- run:
name: Generate Pigeons
working_directory: project
working_directory: project/packages/instabug_flutter
command: sh ./scripts/pigeon.sh
- run:
name: Clone Escape
Expand All @@ -273,11 +280,10 @@ jobs:
cp -f .build/release/Escape /usr/local/bin/escape
- run:
name: Publish Package
working_directory: project
working_directory: project/packages/instabug_flutter
command: Escape flutter publish

workflows:
version: 2
build-test-and-approval-deploy:
jobs:
- danger:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: instabug_flutter_mono

environment:
sdk: '>=3.0.0 <4.0.0'
sdk: '>=2.12.0 <4.0.0'

dev_dependencies:
melos: ^4.1.0

0 comments on commit f7fad8a

Please sign in to comment.