Skip to content

Commit 73f401a

Browse files
authored
Use prebuilt firebase-tools for link check workflow (#12510)
Mirrors dart-lang/site-www#6877 by switching to the prebuilt firebase-tools rather than using it through npm. Will simplify removing more usages of Node and npm in the future. Also should slightly reduce the workflow runtime.
1 parent cb8ec52 commit 73f401a

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ jobs:
8585
sdk: beta
8686
- name: Fetch Dart dependencies
8787
run: dart pub get
88+
- name: Install firebase-tools
89+
run: curl -sL https://firebase.tools | bash
8890
- name: Build site
8991
run: dart run flutter_site build
9092
- name: Check for broken Markdown link references

tool/flutter_site/lib/src/commands/check_links.dart

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,7 @@ Future<int> _checkLinks({bool checkExternal = false}) async {
5555
return 1;
5656
}
5757

58-
final toolVersionOutput = await Process.run('npm', const [
59-
'exec',
60-
'--',
61-
'firebase-tools',
62-
'--version',
63-
]);
58+
final toolVersionOutput = await Process.run('firebase', const ['--version']);
6459

6560
final firebaseToolsVersion = (toolVersionOutput.stdout as String?)?.trim();
6661
if (firebaseToolsVersion == null || firebaseToolsVersion.isEmpty) {
@@ -72,10 +67,7 @@ Future<int> _checkLinks({bool checkExternal = false}) async {
7267
'Using firebase-tools $firebaseToolsVersion to start the '
7368
'Firebase hosting emulator asynchronously...',
7469
);
75-
final emulatorProcess = await Process.start('npm', const [
76-
'exec',
77-
'--',
78-
'firebase-tools',
70+
final emulatorProcess = await Process.start('firebase', const [
7971
'emulators:start',
8072
'--only',
8173
'hosting',

0 commit comments

Comments
 (0)