Skip to content

Commit

Permalink
try fix 123
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle committed Oct 6, 2023
1 parent 386a086 commit f37f8e6
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
1 change: 0 additions & 1 deletion .github/workflows/dart_dart2js.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:

jobs:
test-dart_dart2js:
name: Test
# These tests heavily leverage build_runner which benefits from faster runners
runs-on: ubuntu-latest
timeout-minutes: 60
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/dart_ddc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:

jobs:
test-dart_ddc:
name: Test
# These tests heavily leverage build_runner which benefits from faster runners
runs-on: ubuntu-latest
timeout-minutes: 60
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/dart_native.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ on:

jobs:
test-dart_native:
name: Native Test
timeout-minutes: 60
strategy:
# Allows other matrix items to run if one fails
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/flutter_android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ on:
type: boolean

jobs:
test-flutter_android:
name: Build and Test
flutter-android-build-and-test:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/flutter_ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ on:
type: boolean

jobs:
test-flutter_ios:
name: Build and Test
flutter-ios-build-and-test:
runs-on: macos-latest-xl
timeout-minutes: 30
strategy:
Expand Down
13 changes: 12 additions & 1 deletion actions/bin/log_cw_metric.dart
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,17 @@ Future<void> logMetric() async {
core.info('Sent cloudwatch metric with args: $cloudArgs');
}

/* Notes on Difficulty Getting Failing Step (Oct 6 2023)
1. GithubActions provides no API to directly get failing step name
2. GithubActions provides no API to get the currently running jobId
i. Thus we need to manually parse the jobs of a run, and find the job that matches (done below).
3. GithubActions provides no API to get the actual job name (ie. name: 'job name')
i. If a job name is set, Github job runs use it.
ii. Otherwise they use the github.context.job, which is the job id like "build-and-test" but not the actual numeric job id which is a uuid.
iii. Setting a job name will break this method.
*/
Future<String> getFailingStep(
String jobIdentifier,
String githubToken,
Expand Down Expand Up @@ -188,7 +199,7 @@ Future<String> getFailingStep(
final matchingJob = jobsList.jobs.firstWhere(
(job) => job.name.toLowerCase().contains(jobIdentifier),
orElse: () => throw Exception(
'No job found matching <$jobIdentifier>. Ensure full workflow path run name is unique. Available jobs: ${jobsList.jobs.map((e) => e.name).join(', ')}'));
'No job found matching <$jobIdentifier>. Ensure full workflow path run name is unique. Available jobs: ${jobsList.jobs.map((e) => e.name).join(', ')}. Note that the "jobIdentifier" used do find the proper job uses the job id and not the job name, setting the "name" field in the workflow yaml will break this logic. See comments for more context.'));
final steps = matchingJob.steps;
core.info('steps $steps');

Expand Down

0 comments on commit f37f8e6

Please sign in to comment.