Skip to content

Commit

Permalink
ci: fix ci (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanzoghenzo authored Sep 3, 2023
1 parent acbf6fd commit 960a118
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ name: CI

on:
push:
branches: [main]
branches: ['*']
paths-ignore:
- '**/README.md'
pull_request:
branches: [main]
- 'metadata/**/*'
# pull_request:
# branches: [main]

workflow_dispatch:

jobs:
test:
name: flutter build
name: flutter analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -22,9 +23,9 @@ jobs:
java-version: "11"
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.12.2"
flutter-version: "3.13.2"
- run: flutter pub get
- run: flutter format --set-exit-if-changed .
- run: dart format --set-exit-if-changed .
- run: flutter analyze
# TODO: enable when tests are in place
# - run: flutter test
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
java-version: "11"
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.12.2"
flutter-version: "3.13.2"
- run: flutter pub get
- run: flutter analyze
- run: flutter build apk --release
Expand Down
6 changes: 3 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,10 @@ class _MyHomePageState extends State<MyHomePage> {
var rawBytes = response.bodyBytes;
try {
return utf8.decode(rawBytes);
} catch (_) { }
} catch (_) {}
try {
return (await CharsetDetector.autoDecode(rawBytes)).string;
} catch (_) { }
} catch (_) {}
if (response.headers.containsKey("content-type")) {
String ct = response.headers["content-type"]!;
if (ct.contains("charset")) {
Expand All @@ -286,4 +286,4 @@ class _MyHomePageState extends State<MyHomePage> {
}
throw Exception("Could not get text from the specified URL");
}
}
}

0 comments on commit 960a118

Please sign in to comment.