Skip to content

Commit

Permalink
Merge pull request #8 from leandro-mancini/feat/ci/create-workflow
Browse files Browse the repository at this point in the history
ci(core): create job prepare
  • Loading branch information
leandro-mancini authored Oct 23, 2022
2 parents 14fe95e + e2b3598 commit 2eda42c
Show file tree
Hide file tree
Showing 13 changed files with 157 additions and 64 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/CI-CD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI/CD

on:
push:
tags:
- v*

jobs:
prepare:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
node-version: [16.16.0]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: cache node_modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-build-node-modules-cache-${{ hashFiles('package-lock.json') }}

- name: Use Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- run: git fetch --no-tags --prune --depth=5 origin main

- name: Install deps
if: steps.cache-node-modules.cache-hit != 'true'
run: npm install

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache-key: ${{ runner.os }}-flutter
architecture: x64
- run: flutter --version

build_appbundle:
name: Build flutter appbundle (Android)
needs: prepare
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: cache node_modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-build-node-modules-cache-${{ hashFiles('package-lock.json') }}

- name: Cache Flutter dependencies
uses: actions/cache@v2
with:
path: /opt/hostedtoolcache/flutter
key: ${{ runner.os }}-flutter
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Flutter analyze
run: npx nx run flutter-suflex:build-appbundle
- name: Upload appbundle
uses: actions/upload-artifact@v3
with:
name: appbundle
path: apps/flutter/suflex/build\app\outputs\bundle\release\app-release.aab
71 changes: 71 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI

on:
pull_request:
types: [opened, reopenned, ready_for_review, edited, synchronize]
branches: [main]

jobs:
prepare:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
node-version: [16.16.0]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: cache node_modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-build-node-modules-cache-${{ hashFiles('package-lock.json') }}

- name: Use Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- run: git fetch --no-tags --prune --depth=5 origin main

- name: Install deps
if: steps.cache-node-modules.cache-hit != 'true'
run: npm install

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache-key: ${{ runner.os }}-flutter
architecture: x64
- run: flutter --version

analyze:
needs: prepare
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: cache node_modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-build-node-modules-cache-${{ hashFiles('package-lock.json') }}

- name: Cache Flutter dependencies
uses: actions/cache@v2
with:
path: /opt/hostedtoolcache/flutter
key: ${{ runner.os }}-flutter
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Flutter analyze
run: npx nx run-many --target=analyze --all=true
- name: Flutter format
run: npx nx run-many --target=format --all=true
21 changes: 1 addition & 20 deletions apps/flutter/suflex/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,7 @@
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:flutter_suflex/main.dart';

void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());

// 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);
});

}
2 changes: 1 addition & 1 deletion libs/flutter/api/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences_ios","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_ios-2.1.1\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"shared_preferences_android","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_android-2.0.14\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_macos-2.0.4\\\\","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.1.7\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_linux-2.1.1\\\\","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.1.3\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_windows-2.1.1\\\\","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"shared_preferences_web","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_web-2.0.4\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2022-10-22 02:16:40.347073","version":"3.0.5"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences_ios","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_ios-2.1.1\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"shared_preferences_android","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_android-2.0.14\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_macos-2.0.4\\\\","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.1.7\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_linux-2.1.1\\\\","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.1.3\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_windows-2.1.1\\\\","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"shared_preferences_web","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_web-2.0.4\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2022-10-23 12:00:24.022724","version":"3.0.5"}
11 changes: 1 addition & 10 deletions libs/flutter/api/test/flutter_api_test.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
import 'package:flutter_test/flutter_test.dart';

import 'package:flutter_api/flutter_api.dart';

void main() {
test('adds one to input values', () {
final calculator = Calculator();
expect(calculator.addOne(2), 3);
expect(calculator.addOne(-7), -6);
expect(calculator.addOne(0), 1);
});

}
2 changes: 1 addition & 1 deletion libs/flutter/characters/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences_ios","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_ios-2.1.1\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"shared_preferences_android","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_android-2.0.14\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_macos-2.0.4\\\\","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.1.7\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_linux-2.1.1\\\\","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.1.3\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_windows-2.1.1\\\\","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"shared_preferences_web","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_web-2.0.4\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2022-10-22 05:18:52.864957","version":"3.0.5"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences_ios","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_ios-2.1.1\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"shared_preferences_android","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_android-2.0.14\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_macos-2.0.4\\\\","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.1.7\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_linux-2.1.1\\\\","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.1.3\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_windows-2.1.1\\\\","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"shared_preferences_web","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_web-2.0.4\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2022-10-23 13:24:11.952900","version":"3.0.5"}
2 changes: 0 additions & 2 deletions libs/flutter/characters/lib/src/widgets/filters_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ class _FiltersWidgetState extends State<FiltersWidget> {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0),
),
primary: Colors.red,
onPrimary: Colors.white,
),
child: const Text('APLICAR'),
),
Expand Down
3 changes: 2 additions & 1 deletion libs/flutter/characters/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: flutter_characters
description: A new Flutter package project.
version: 0.0.1
publish_to: none
homepage:

environment:
Expand All @@ -17,7 +18,7 @@ dependencies:
intl: ^0.17.0
skeletons: ^0.0.3
flutter_api:
path: ../api
path: ./../api
flutter_shared:
path: ../shared

Expand Down
10 changes: 1 addition & 9 deletions libs/flutter/characters/test/flutter_characters_test.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import 'package:flutter_test/flutter_test.dart';

import 'package:flutter_characters/flutter_characters.dart';

void main() {
test('adds one to input values', () {
final calculator = Calculator();
expect(calculator.addOne(2), 3);
expect(calculator.addOne(-7), -6);
expect(calculator.addOne(0), 1);
});

}
Loading

0 comments on commit 2eda42c

Please sign in to comment.