-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: github actions and provider changes
- Loading branch information
Showing
7 changed files
with
97 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Dart | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
validate_changes: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd60 | ||
- name: Install dependencies | ||
run: dart pub get | ||
- name: Verify formatting | ||
run: dart format lib example test --output=none --set-exit-if-changed . | ||
- name: Analyze project source | ||
run: dart analyze example lib test | ||
windows_tests: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd60 | ||
- name: Install dependencies | ||
run: dart pub get | ||
- name: Run tests | ||
run: dart test | ||
linux_tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd60 | ||
- name: Install dependencies | ||
run: dart pub get | ||
- name: Run tests | ||
run: dart test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:collection/collection.dart'; | ||
import 'package:test/test.dart'; | ||
import 'package:type_face_provider/src/provider.dart'; | ||
|
||
void main() { | ||
group('Fetching system fonts', () { | ||
test('Platform - Linux', () async { | ||
if (!Platform.isLinux) { | ||
markTestSkipped('Skipped - test can be only ran on Linux.'); | ||
return; | ||
} | ||
|
||
final provider = TypefacesProvider.platform; | ||
final typefaces = (await provider.getTypefaces()); | ||
expect(typefaces.isNotEmpty, true, | ||
reason: "Any system must have at least one font installed!"); | ||
final font = typefaces.firstWhereOrNull((e) => | ||
e.file.path == '/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf'); | ||
expect(font != null, true, | ||
reason: 'DejaVu Sans was not found on the system.'); | ||
if (font != null) { | ||
expect(font.names, ['DejaVu Sans Mono']); | ||
expect(font.file.path, | ||
'/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf'); | ||
expect(font.styles, ['Book']); | ||
expect(font.fullNames, ['DejaVu Sans Mono']); | ||
} | ||
}); | ||
}); | ||
} |