Skip to content

Commit

Permalink
Workflow cleanups (#846)
Browse files Browse the repository at this point in the history
* Add pubspec overrides

* Remove tool to change deps

* Fix override

* Add health workflow

* Do not test breaking changes

* Remove health workflow

* Switch to dart script

* Fix path

* Add newlines

* Fixes
  • Loading branch information
mosuem authored Dec 5, 2023
1 parent 4282d81 commit a0949f5
Show file tree
Hide file tree
Showing 22 changed files with 78 additions and 84 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/native.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,8 @@ jobs:
ndk-version: r26b
if: ${{ matrix.sdk == 'stable' }}

- run: dart pub get -C ../../tools/
if: ${{ matrix.dependencies == 'path' }}

- run: dart ../../tools/bin/change_dependencies.dart
if: ${{ matrix.dependencies == 'path' }}
- run: dart run ../../tools/delete_pubspec_overrides.dart
if: ${{ matrix.dependencies == 'published' }}

- run: dart pub get

Expand Down
3 changes: 3 additions & 0 deletions pkgs/native_assets_builder/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependency_overrides:
native_assets_cli:
path: ../native_assets_cli/
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependency_overrides:
native_assets_cli:
path: ../../../../native_assets_cli/
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependency_overrides:
native_assets_cli:
path: ../../../../native_assets_cli/
10 changes: 10 additions & 0 deletions pkgs/native_assets_builder/test/data/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
# a completely clean setup.
- cyclic_package_1/build.dart
- cyclic_package_1/pubspec.yaml
- cyclic_package_1/pubspec_overrides.yaml
- cyclic_package_2/build.dart
- cyclic_package_2/pubspec.yaml
- cyclic_package_2/pubspec_overrides.yaml
- dart_app/bin/dart_app.dart
- dart_app/pubspec.yaml
- native_add/build.dart
Expand All @@ -12,6 +14,7 @@
- native_add/lib/src/native_add_bindings_generated.dart
- native_add/lib/src/native_add.dart
- native_add/pubspec.yaml
- native_add/pubspec_overrides.yaml
- native_add/src/native_add.c
- native_add/src/native_add.h
- native_add/test/native_add_test.dart
Expand All @@ -21,19 +24,26 @@
- native_subtract/lib/src/native_subtract_bindings_generated.dart
- native_subtract/lib/src/native_subtract.dart
- native_subtract/pubspec.yaml
- native_subtract/pubspec_overrides.yaml
- native_subtract/src/native_subtract.c
- native_subtract/src/native_subtract.h
- package_reading_metadata/build.dart
- package_reading_metadata/pubspec.yaml
- package_reading_metadata/pubspec_overrides.yaml
- package_with_metadata/build.dart
- package_with_metadata/pubspec.yaml
- package_with_metadata/pubspec_overrides.yaml
- some_dev_dep/bin/some_dev_dep.dart
- some_dev_dep/pubspec.yaml
- wrong_build_output/build.dart
- wrong_build_output/pubspec.yaml
- wrong_build_output/pubspec_overrides.yaml
- wrong_build_output_2/build.dart
- wrong_build_output_2/pubspec.yaml
- wrong_build_output_2/pubspec_overrides.yaml
- wrong_build_output_3/build.dart
- wrong_build_output_3/pubspec.yaml
- wrong_build_output_3/pubspec_overrides.yaml
- wrong_namespace_asset/build.dart
- wrong_namespace_asset/pubspec.yaml
- wrong_namespace_asset/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- lib/src/native_add_bindings_generated.dart
- lib/src/native_add.dart
- pubspec.yaml
- pubspec_overrides.yaml
- src/native_add.c
- src/native_add.h
- test/native_add_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dependency_overrides:
native_assets_cli:
path: ../../../../native_assets_cli/
native_toolchain_c:
path: ../../../../native_toolchain_c/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dependency_overrides:
native_assets_cli:
path: ../../../../native_assets_cli/
native_toolchain_c:
path: ../../../../native_toolchain_c/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dependency_overrides:
native_assets_cli:
path: ../../../../native_assets_cli/
native_toolchain_c:
path: ../../../../native_toolchain_c/
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependency_overrides:
native_assets_cli:
path: ../../../../native_assets_cli/
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependency_overrides:
native_assets_cli:
path: ../../../../native_assets_cli/
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependency_overrides:
native_assets_cli:
path: ../../../../native_assets_cli/
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependency_overrides:
native_assets_cli:
path: ../../../../native_assets_cli/
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependency_overrides:
native_assets_cli:
path: ../../../../native_assets_cli/
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependency_overrides:
native_assets_cli:
path: ../../../../native_assets_cli/
13 changes: 9 additions & 4 deletions pkgs/native_assets_builder/test/helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,15 @@ Future<void> copyTestProjects({
for (final path in manifestYaml.contents as YamlList)
Uri(path: path as String)
];
final filesToCopy =
manifest.where((e) => e.pathSegments.last != 'pubspec.yaml').toList();
final filesToModify =
manifest.where((e) => e.pathSegments.last == 'pubspec.yaml').toList();
final filesToCopy = manifest
.where((e) => !(e.pathSegments.last.startsWith('pubspec') &&
e.pathSegments.last.endsWith('.yaml')))
.toList();
final filesToModify = manifest
.where((e) =>
e.pathSegments.last.startsWith('pubspec') &&
e.pathSegments.last.endsWith('.yaml'))
.toList();

for (final pathToCopy in filesToCopy) {
final sourceFile = File.fromUri(sourceUri.resolveUri(pathToCopy));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dependency_overrides:
native_assets_cli:
path: ../../../native_assets_cli/
native_toolchain_c:
path: ../../../native_toolchain_c/
3 changes: 3 additions & 0 deletions pkgs/native_toolchain_c/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependency_overrides:
native_assets_cli:
path: ../native_assets_cli/
9 changes: 0 additions & 9 deletions tools/.gitignore

This file was deleted.

52 changes: 0 additions & 52 deletions tools/bin/change_dependencies.dart

This file was deleted.

6 changes: 6 additions & 0 deletions tools/delete_pubspec_overrides.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import 'dart:io';

void main(List<String> arguments) => Directory.current
.list(recursive: true)
.where((f) => f.path.endsWith('pubspec_overrides.yaml'))
.forEach((f) => f.deleteSync());
14 changes: 0 additions & 14 deletions tools/pubspec.yaml

This file was deleted.

0 comments on commit a0949f5

Please sign in to comment.