diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml new file mode 100644 index 0000000..26cfc88 --- /dev/null +++ b/.github/workflows/build-debug.yml @@ -0,0 +1,45 @@ +name: Build Debug + +env: + FLUTTER_VERSION: 3.22.2 + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "main" branch + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + android: + runs-on: ubuntu-latest + steps: + - name: Clone repository + uses: actions/checkout@v4 + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + flutter-version: ${{env.FLUTTER_VERSION}} + - run: flutter pub get + - run: flutter test + - run: flutter build apk --debug + + ios: + runs-on: macos-latest + steps: + - name: Clone repository + uses: actions/checkout@v4 + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + flutter-version: ${{env.FLUTTER_VERSION}} + - run: flutter pub get + - run: flutter test + - run: flutter build ios --debug --no-codesign diff --git a/test/gitkeep_test.dart b/test/gitkeep_test.dart new file mode 100644 index 0000000..878f617 --- /dev/null +++ b/test/gitkeep_test.dart @@ -0,0 +1,9 @@ +// This is a noop to prevent flutter from failing when no test cases exist. + +import 'package:flutter_test/flutter_test.dart'; + +void main() { + test('Noop test', () { + expect(true, true); + }); +} diff --git a/test/widget_test.dart b/test/widget_test.dart deleted file mode 100644 index bf2b11a..0000000 --- a/test/widget_test.dart +++ /dev/null @@ -1,30 +0,0 @@ -// This is a basic Flutter widgets test. -// -// To perform an interaction with a widgets in your test, use the WidgetTester -// utility that Flutter provides. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widgets -// tree, read text, and verify that the values of widgets properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:untare/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(const Tare()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -}