Skip to content

Commit

Permalink
fix file
Browse files Browse the repository at this point in the history
  • Loading branch information
mosuem committed Nov 15, 2024
1 parent b8a636f commit 7286544
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/ecosystem_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Read repository list
id: repos
run: echo "REPOSITORIES_FILE=${{ inputs.repos_file }}" >> $GITHUB_ENV

- name: Setup Dart
uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
Expand All @@ -47,7 +43,6 @@ jobs:
echo "${{ inputs.package_name }}"
echo "${{ inputs.new_version }}"
echo "${{ inputs.level }}"
echo $REPOSITORIES_FILE
dart run pkgs/quest/bin/quest.dart ${{ inputs.package_name }} ${{ inputs.new_version }} ${{ inputs.level }}
dart run pkgs/quest/bin/quest.dart ${{ inputs.package_name }} ${{ inputs.new_version }} ${{ inputs.level }} ${{ inputs.repos_file }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 8 additions & 7 deletions pkgs/quest/bin/quest.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Future<void> main(List<String> arguments) async {
final candidatePackage = arguments.first;
final version = arguments[1];
final level = Level.values.firstWhere((l) => l.name == arguments[2]);
final chronicles = await Quest(candidatePackage, version, level).embark();
final repositoriesFile = arguments[3];
final chronicles =
await Quest(candidatePackage, version, level, repositoriesFile).embark();
print(chronicles);
}

Expand Down Expand Up @@ -50,12 +52,13 @@ class Quest {
final String candidatePackage;
final String version;
final Level level;
final String repositoriesFile;

Quest(this.candidatePackage, this.version, this.level);
Quest(this.candidatePackage, this.version, this.level, this.repositoriesFile);

Future<Chronicles> embark() async {
final chapters = <Chapter>[];
for (var repository in await getRepositories()) {
for (var repository in await getRepositories(repositoriesFile)) {
final applicationName = await cloneRepo(repository);
print('Cloned $repository');
final processResult = await Process.run('flutter', [
Expand Down Expand Up @@ -98,10 +101,8 @@ class Quest {
return Chronicles(candidatePackage, version, level, chapters);
}

Future<Iterable<String>> getRepositories() async =>
await File(
const String.fromEnvironment('REPOSITORIES_FILE'),
).readAsLines();
Future<Iterable<String>> getRepositories(String path) async =>
await File(path).readAsLines();

Future<String> cloneRepo(String repository) async {
var applicationName = repository.split('/').last;
Expand Down
9 changes: 7 additions & 2 deletions pkgs/quest/test/quest_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import '../bin/quest.dart';
void main() {
test('test name', () async {
final chronicles =
await FakeQuest('intl', '^0.20.0', Level.analyze).embark();
await FakeQuest('intl', '^0.20.0', Level.analyze, '').embark();
print(chronicles);
}, timeout: const Timeout(Duration(minutes: 5)));
}
Expand All @@ -18,7 +18,12 @@ class FakeQuest extends Quest {
'/home/mosum/projects/ecosystem_testing/my_app_new_web/',
};

FakeQuest(super.candidatePackage, super.version, super.level);
FakeQuest(
super.candidatePackage,
super.version,
super.level,
super.repositoriesFile,
);

@override
Future<String> cloneRepo(String repository) async {
Expand Down

0 comments on commit 7286544

Please sign in to comment.