Skip to content

Commit

Permalink
Merge pull request #231 from spydon/repo-consistency
Browse files Browse the repository at this point in the history
refactor: Consistency with other repositories
  • Loading branch information
spydon authored Dec 6, 2023
2 parents f68fb08 + 473ee87 commit 9bd4207
Show file tree
Hide file tree
Showing 68 changed files with 133 additions and 162 deletions.
12 changes: 12 additions & 0 deletions .github/codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
comment: false
ignore:
- "**/*.g.dart"
- "**/*.freezed.dart"

coverage:
precision: 2
round: down
range: 80...100
status:
project:
patch: off
7 changes: 6 additions & 1 deletion renovate.json → .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>canonical/ubuntu-flutter-plugins"
]
],
"enabledManagers": [
"github-actions",
"pub"
],
"schedule": ["after 9am and before 2pm every monday"]
}
56 changes: 25 additions & 31 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,23 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: asdf-vm/actions/install@v2
- run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- run: flutter pub global activate melos
- run: melos pub get
- uses: bluefireteam/melos-action@v2
- run: melos analyze

format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: asdf-vm/actions/install@v2
- run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- run: flutter pub global activate melos
- run: melos pub get
- uses: bluefireteam/melos-action@v2
- run: melos format

mocks:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: asdf-vm/actions/install@v2
- run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- run: flutter pub global activate melos
- run: melos pub get
- uses: bluefireteam/melos-action@v2
- run: melos generate
- name: Check for outdated mocks
if: github.event_name != 'push'
Expand All @@ -55,9 +49,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: asdf-vm/actions/install@v2
- run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- run: flutter pub global activate melos
- run: melos pub get
- uses: bluefireteam/melos-action@v2
- run: melos gen-l10n
- name: Check for outdated l10n
if: github.event_name == 'pull_request'
Expand All @@ -77,10 +69,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: asdf-vm/actions/install@v2
- run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- uses: bluefireteam/melos-action@v2
- run: sudo apt update && sudo apt install -y lcov
- run: flutter pub global activate melos
- run: melos pub get
- run: melos coverage
- uses: codecov/codecov-action@v3
with:
Expand All @@ -89,19 +79,23 @@ jobs:
integration:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: asdf-vm/actions/install@v2
- run: sudo apt update
- run: sudo apt install -y clang cmake curl dbus dbus-x11 fwupd fwupd-tests gsettings-desktop-schemas libgtk-3-dev ninja-build pkg-config unzip upower xvfb
env:
DEBIAN_FRONTEND: noninteractive
- name: Prepare environment
run: |
sudo sed -i 's/DisabledPlugins=.*/DisabledPlugins=invalid;bios/g' /etc/fwupd/daemon.conf
echo "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$UID/bus" >> $GITHUB_ENV
echo "XDG_RUNTIME_DIR=/run/user/$UID" >> $GITHUB_ENV
echo "FLUTTER_ROOT=$(asdf where flutter)" >> $GITHUB_ENV
gsettings set org.gnome.desktop.interface gtk-theme 'Yaru'
- run: sudo fwupdmgr enable-remote fwupd-tests
- run: sudo fwupdmgr get-devices
- run: sudo -E xvfb-run -a -s '-screen 0 1024x768x24 +extension GLX' $FLUTTER_ROOT/bin/flutter test integration_test
- uses: actions/checkout@v3
- uses: asdf-vm/actions/install@v2
- uses: bluefireteam/melos-action@v2
- run: sudo apt update
- run: sudo apt install -y clang cmake curl dbus dbus-x11 fwupd fwupd-tests gsettings-desktop-schemas libgtk-3-dev ninja-build pkg-config unzip upower xvfb
env:
DEBIAN_FRONTEND: noninteractive
- name: Prepare environment
run: |
sudo sed -i 's/DisabledPlugins=.*/DisabledPlugins=invalid;bios/g' /etc/fwupd/daemon.conf
echo "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$UID/bus" >> $GITHUB_ENV
echo "XDG_RUNTIME_DIR=/run/user/$UID" >> $GITHUB_ENV
echo "FLUTTER_ROOT=$(asdf where flutter)" >> $GITHUB_ENV
gsettings set org.gnome.desktop.interface gtk-theme 'Yaru'
- run: sudo fwupdmgr enable-remote fwupd-tests
- run: sudo fwupdmgr get-devices
- run: |
cd packages/firmware_updater && \
sudo -E xvfb-run -a -s '-screen 0 1024x768x24 +extension GLX' \
$FLUTTER_ROOT/bin/flutter test integration_test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
.packages
.pub-cache/
.pub/
/build/
*/**/build/
/coverage/
pubspec.lock

Expand Down
45 changes: 0 additions & 45 deletions analysis_options.yaml

This file was deleted.

File renamed without changes.
4 changes: 0 additions & 4 deletions codecov.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions melos.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: firmware_updater
name: firmware_updater_workspace

packages:
- .
- packages/**

scripts:
Expand Down
1 change: 1 addition & 0 deletions packages/firmware_notifier/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:ubuntu_lints/analysis_options.yaml
13 changes: 7 additions & 6 deletions packages/firmware_notifier/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ publish_to: 'none'
environment:
sdk: '>=3.0.0 <4.0.0'

dev_dependencies:
build_runner: ^2.3.2
lints: ^2.0.0
mockito: 5.4.2
test: ^1.16.0

dependencies:
collection: ^1.17.0
dbus: ^0.7.8
desktop_notifications: ^0.6.3
fwupd: ^0.2.2
meta: ^1.8.0

dev_dependencies:
build_runner: ^2.3.2
mockito: 5.4.2
test: ^1.16.0
ubuntu_lints: ^0.1.0

1 change: 1 addition & 0 deletions packages/firmware_updater/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:ubuntu_lints/analysis_options.yaml
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class DeviceModel extends SafeChangeNotifier {
final FwupdService _service;
FwupdDevice _device;
List<FwupdRelease>? _releases;
StreamSubscription? _sub;
StreamSubscription<FwupdDevice>? _sub;

Future<void> init() async {
_sub =
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -57,38 +57,39 @@ class FwupdMockService extends FwupdService {
}

final file = File(simulateYamlFilePath!);
final YamlList doc = loadYaml(file.readAsStringSync());
final doc = loadYaml(file.readAsStringSync()) as YamlList;

return Future.value([
for (final device in doc)
FwupdDevice(
deviceId: device['deviceId'],
name: device['name'],
vendor: device['vendor'],
version: device['version'],
versionBootloader: device['versionBootloader'],
versionLowest: device['versionLowest'],
deviceId: device['deviceId'] as String,
name: device['name'] as String,
vendor: device['vendor'] as String?,
version: device['version'] as String?,
versionBootloader: device['versionBootloader'] as String?,
versionLowest: device['versionLowest'] as String?,
versionFormat: FwupdVersionFormat.values
.firstWhere((e) => e.toString() == device['versionFormat']),
protocol: device['protocol'],
plugin: device['plugin'],
guid: [device['guid']],
vendorId: device['vendorId'],
icon: [device['icon']],
checksum: device['checksum'],
protocol: device['protocol'] as String?,
plugin: device['plugin'] as String,
guid: device['guid'] == null ? [] : [device['guid'] as String],
vendorId: device['vendorId'] as String?,
icon: device['icon'] == null ? [] : [device['icon'] as String],
checksum: device['checksum'] as String?,
created: (device['created'] != null)
? DateTime.parse(device['created'])
? DateTime.parse(device['created'] as String)
: null,
modified: (device['modified'] != null)
? DateTime.parse(device['modified'])
? DateTime.parse(device['modified'] as String)
: null,
parentDeviceId: device['parentDeviceId'],
parentDeviceId: device['parentDeviceId'] as String?,
flags: (device['flags'] as YamlList)
.value
.map((e) => FwupdDeviceFlag.values
.firstWhere((f) => f.toString() == e.toString()))
.map((e) => FwupdDeviceFlag.values.firstWhere(
(f) => f.toString() == e.toString(),
))
.toSet(),
summary: device['summary'],
summary: device['summary'] as String?,
updateState: FwupdUpdateState.values
.firstWhere((e) => e.toString() == device['updateState']),
),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function(APPLY_STANDARD_SETTINGS TARGET)
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
endfunction()

set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
set(FLUTTER_MANAGED_DIR "flutter")

# Flutter library and tool build rules.
add_subdirectory(${FLUTTER_MANAGED_DIR})
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
54 changes: 54 additions & 0 deletions packages/firmware_updater/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: firmware_updater
description: Firmware Updater
publish_to: "none"

environment:
sdk: ">=3.0.0 <4.0.0"
flutter: 3.13.7

dependencies:
collection: ^1.17.2
dbus: ^0.7.8
dio: ^5.3.3
file: ^6.1.4
flutter:
sdk: flutter
flutter_html: ^3.0.0-beta.2
flutter_localizations:
sdk: flutter
freezed_annotation: ^2.4.1
fwupd:
git:
url: https://github.com/d-loose/fwupd.dart
ref: refresh-property-cache
gtk: ^2.1.0
handy_window: ^0.3.1
meta: ^1.9.1
path: ^1.8.3
provider: ^6.0.5
safe_change_notifier: ^0.3.1
ubuntu_logger: ^0.1.0
ubuntu_service: ^0.2.4
ubuntu_test: ^0.1.0-beta.4
upower: ^0.7.0
yaml: ^3.1.2
yaru: ^1.1.0
yaru_colors: ^0.1.7
yaru_icons: ^2.2.2
yaru_widgets: ^3.2.2

dev_dependencies:
build_runner: ^2.2.0
flutter_test:
sdk: flutter
freezed: ^2.1.0+1
integration_test:
sdk: flutter
mockito: 5.4.2
ubuntu_lints: ^0.1.0

flutter:
generate: true
uses-material-design: true
assets:
- assets/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 9bd4207

Please sign in to comment.