-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add basic CI file * run tests in CI * add Makefile, lint options & fix lint errors * fix lint errors * correct format code --------- Co-authored-by: Omer Akram <[email protected]>
- Loading branch information
Showing
10 changed files
with
273 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,26 @@ | ||
name: Wampproto Dart CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Dart | ||
uses: dart-lang/setup-dart@v1 | ||
with: | ||
sdk: 3.3.0 | ||
|
||
- name: Install dependencies | ||
run: make install | ||
|
||
- name: Verify formatting | ||
run: make format | ||
|
||
- name: Check lint | ||
run: make lint | ||
|
||
- name: Run tests | ||
run: make 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
install: | ||
dart pub get | ||
|
||
lint: | ||
dart analyze | ||
|
||
lint-fix: | ||
dart fix --apply | ||
|
||
format: | ||
dart format --output=none --set-exit-if-changed . | ||
|
||
test: | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export 'src/messages/hello.dart' show Hello; | ||
export "src/messages/hello.dart" show Hello; |
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 |
---|---|---|
@@ -1 +1 @@ | ||
export 'src/serializers/json.dart' show JsonSerializer; | ||
export "src/serializers/json.dart" show JsonSerializer; |
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import 'dart:convert'; | ||
import 'dart:typed_data'; | ||
import "dart:convert"; | ||
import "dart:typed_data"; | ||
|
||
import 'package:wampproto/src/messages/message.dart'; | ||
import 'package:wampproto/src/serializers/serializer.dart'; | ||
import "package:wampproto/src/messages/message.dart"; | ||
import "package:wampproto/src/serializers/serializer.dart"; | ||
|
||
class JsonSerializer implements Serializer { | ||
@override | ||
Uint8List serialize(Message message) { | ||
Uint8List serialize(final Message message) { | ||
var jsonString = jsonEncode(message.marshal()); | ||
return Uint8List.fromList(jsonString.codeUnits); | ||
} | ||
|
||
@override | ||
Message deserialize(Uint8List message) { | ||
String s = String.fromCharCodes(message); | ||
Message deserialize(final Uint8List message) { | ||
final String s = String.fromCharCodes(message); | ||
|
||
List<dynamic> wampMessage = jsonDecode(s); | ||
final List<dynamic> wampMessage = jsonDecode(s); | ||
return toMessage(wampMessage); | ||
} | ||
} |
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