Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature ci/cd #65

Open
wants to merge 115 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
ee56eda
Testing
filip-ams Aug 28, 2024
4b85293
Merge pull request #58 from ant-media/test_ci_cd
filip-ams Aug 28, 2024
d5e181b
changed trigger
filip-ams Aug 28, 2024
a3107cb
aa
filip-ams Aug 28, 2024
cc592ac
a
filip-ams Aug 28, 2024
149dee6
added path to build
filip-ams Aug 29, 2024
7e229a1
path for format/pub get
filip-ams Aug 29, 2024
e3d0c26
format seems to be depricated
filip-ams Aug 29, 2024
e826ae3
fixed path
filip-ams Aug 29, 2024
5be2105
Test
filip-ams Aug 29, 2024
746a4ee
a
filip-ams Aug 29, 2024
f280f0f
TEST
filip-ams Aug 29, 2024
7ce4783
removed widget test for now
filip-ams Aug 29, 2024
13f3d64
test
filip-ams Aug 29, 2024
a5197bc
Test
filip-ams Aug 29, 2024
e46b273
podfile update
filip-ams Aug 29, 2024
a208d2f
minor fix
filip-ams Aug 29, 2024
e968720
a
filip-ams Aug 29, 2024
72aee96
m
filip-ams Aug 29, 2024
065ba9a
m
filip-ams Aug 29, 2024
02d7686
m
filip-ams Aug 29, 2024
ee67caf
m
filip-ams Aug 29, 2024
414fef2
m
filip-ams Aug 29, 2024
242731f
ios build test
filip-ams Sep 2, 2024
a6ad735
m
filip-ams Sep 2, 2024
e07cf56
m
filip-ams Sep 2, 2024
b2d9318
m
filip-ams Sep 2, 2024
a38b24a
m
filip-ams Sep 2, 2024
a12d60d
added widget tests to our sample app's / updated yml to run them.
filip-ams Sep 2, 2024
9325d0e
m
filip-ams Sep 2, 2024
c4dc656
m
filip-ams Sep 2, 2024
afac02f
t
filip-ams Sep 3, 2024
935fadb
removed get.snackbar, updated test
filip-ams Sep 5, 2024
74c23fc
Modified .main to be easier to test, added permission_test.dart, adde…
filip-ams Sep 23, 2024
6a6fd7b
Modified .main to be easier to test, added permission_test.dart, adde…
filip-ams Sep 23, 2024
8728879
minor change
filip-ams Sep 23, 2024
b6ccd58
Added p2p test and also updated the publish.yml to run a emulator
filip-ams Sep 24, 2024
76abc9b
emulator fix
filip-ams Sep 24, 2024
93581f7
emulator fix
filip-ams Sep 24, 2024
3bebcc1
Added data channel test
filip-ams Sep 24, 2024
385ae57
Additional tests/fixes
filip-ams Sep 27, 2024
8939e96
Additional tests/fixes
filip-ams Oct 4, 2024
8521af8
Additional tests/fixes
filip-ams Oct 4, 2024
caa9962
Additional tests/fixes
filip-ams Oct 4, 2024
8bc3d9a
Additional tests/fixes
filip-ams Oct 4, 2024
744b8ca
Additional tests/fixes
filip-ams Oct 4, 2024
6b2acdc
Additional tests/fixes
filip-ams Oct 4, 2024
4a81770
Additional tests/fixes
filip-ams Oct 4, 2024
d032fb0
Added android emulator
filip-ams Oct 4, 2024
d81b321
Added android emulator
filip-ams Oct 4, 2024
ff61b97
Added android emulator
filip-ams Oct 4, 2024
05d3cec
Added android emulator
filip-ams Oct 4, 2024
3bf0ddd
Added android emulator
filip-ams Oct 4, 2024
3883593
Added android emulator
filip-ams Oct 4, 2024
645abc6
Added android emulator
filip-ams Oct 4, 2024
18b3a4c
Added android emulator
filip-ams Oct 4, 2024
80bf899
Added android emulator
filip-ams Oct 4, 2024
ebfa597
Added android emulator
filip-ams Oct 4, 2024
5a28996
Added android emulator
filip-ams Oct 4, 2024
b959851
Added android emulator
filip-ams Oct 7, 2024
f518ed2
Added android emulator
filip-ams Oct 7, 2024
b8858e1
Added android emulator
filip-ams Oct 7, 2024
2fd1ad6
Added android emulator
filip-ams Oct 7, 2024
59cc0e7
Added android emulator
filip-ams Oct 7, 2024
fe58848
Added android emulator
filip-ams Oct 7, 2024
7f58943
Added android emulator
filip-ams Oct 7, 2024
a65aaa0
Added android emulator
filip-ams Oct 7, 2024
34bab0a
Added android emulator
filip-ams Oct 7, 2024
e24e18e
Added android emulator
filip-ams Oct 7, 2024
b26c048
Added android emulator
filip-ams Oct 7, 2024
991e8d6
Added android emulator
filip-ams Oct 7, 2024
86f1984
Testing
filip-ams Oct 7, 2024
5d872ae
Testing
filip-ams Oct 7, 2024
bb55ef9
Testing
filip-ams Oct 7, 2024
db3810d
Testing
filip-ams Oct 7, 2024
bc76dba
Testing
filip-ams Oct 7, 2024
3edd6d0
Removed Getx library, added Toast, removed Route Item,refactored main…
filip-ams Oct 7, 2024
6917599
testing
filip-ams Oct 7, 2024
e60071c
testing
filip-ams Oct 7, 2024
8c5fcab
testing
filip-ams Oct 7, 2024
f931352
testing
filip-ams Oct 7, 2024
b344e74
testing
filip-ams Oct 7, 2024
83383f0
testing
filip-ams Oct 7, 2024
890937b
testing
filip-ams Oct 7, 2024
c80e8a5
testing
filip-ams Oct 7, 2024
bcafb69
testing
filip-ams Oct 7, 2024
699f744
testing
filip-ams Oct 7, 2024
160b554
testing
filip-ams Oct 7, 2024
d0ce686
testing
filip-ams Oct 7, 2024
29ef5c9
testing
filip-ams Oct 7, 2024
cba18f0
testing
filip-ams Oct 7, 2024
7854254
testing
filip-ams Oct 7, 2024
d84544f
testing
filip-ams Oct 7, 2024
9c7bd87
testing
filip-ams Oct 8, 2024
4a2405c
Uncommented the upload package + reverted the trigger
filip-ams Oct 10, 2024
987b950
Refactored tests
filip-ams Oct 10, 2024
da8f34a
Merge pull request #59 from ant-media/test_ci_cd
mustafaboleken Oct 11, 2024
e98a5b7
Tests
filip-ams Oct 28, 2024
d305b42
Tests for conference app
filip-ams Oct 28, 2024
c92ffca
Tests for conference app
filip-ams Oct 28, 2024
7f32d2a
Tests for conference app
filip-ams Oct 30, 2024
0de55e2
test
filip-ams Oct 31, 2024
f63383a
change to trigger ci
filip-ams Oct 31, 2024
0d83604
change to trigger conf test
filip-ams Oct 31, 2024
0da9e7e
change to trigger conf test
filip-ams Oct 31, 2024
9349eed
change to trigger conf test
filip-ams Oct 31, 2024
df87307
change to trigger conf test
filip-ams Oct 31, 2024
9583453
change to trigger conf test
filip-ams Oct 31, 2024
6bce7ac
change to trigger conf test
filip-ams Oct 31, 2024
c79a1f2
change to trigger conf test
filip-ams Oct 31, 2024
2c4f7eb
Minor changes
filip-ams Nov 1, 2024
7b5b679
Minor changes
filip-ams Nov 1, 2024
748aa40
Minor changes
filip-ams Nov 1, 2024
f742886
Minor changes
filip-ams Nov 1, 2024
d6dc122
Minor changes
filip-ams Nov 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 46 additions & 20 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,63 @@

name: Publish Package

on:
push:
branches: [ main ]
branches:
- feature_ci/cd

schedule:
- cron: '0 0 * * 2'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'beta'
- name: Install dependencies
run: flutter pub get
- name: Setup Pub Credentials
shell: bash
env:
PUB_DEV_PUBLISH_ACCESS_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }}
PUB_DEV_PUBLISH_REFRESH_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }}
PUB_DEV_PUBLISH_TOKEN_ENDPOINT: ${{ secrets.PUB_DEV_PUBLISH_TOKEN_ENDPOINT }}
PUB_DEV_PUBLISH_EXPIRATION: ${{ secrets.PUB_DEV_PUBLISH_EXPIRATION }}
run: |
sh ./pub_login.sh
- name: Check Publish Warnings
run: |
sudo cat /$HOME/.config/dart/pub-credentials.json
flutter pub publish --dry-run
- name: Publish Package
channel: 'stable'

- name: Enable KVM group perms
run: |
yes | flutter pub publish
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm


- name: Run sample application integration tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
script: |
cd example/SampleProject && flutter test integration_test/test_conference.dart
cd example/SampleProject && flutter test integration_test/test_play.dart


# Uncomment and adjust for publishing your package
# - name: Setup Pub Credentials
# shell: bash
# env:
# PUB_DEV_PUBLISH_ACCESS_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }}
# PUB_DEV_PUBLISH_REFRESH_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }}
# PUB_DEV_PUBLISH_TOKEN_ENDPOINT: ${{ secrets.PUB_DEV_PUBLISH_TOKEN_ENDPOINT }}
# PUB_DEV_PUBLISH_EXPIRATION: ${{ secrets.PUB_DEV_PUBLISH_EXPIRATION }}
# run: |
# sh ./pub_login.sh
#
# - name: Check Publish Warnings
# run: |
# sudo cat /$HOME/.config/dart/pub-credentials.json
# flutter pub publish --dry-run
#
# - name: Publish Package
# run: |
# yes | flutter pub publish
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
33 changes: 33 additions & 0 deletions example/SampleProject/integration_test/test_conference.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'test_helper.dart';

void main() {
// Initialize the integration test bindings.
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

testWidgets('Runs the app, taps on the settings icon, enters the URL, and runs the Conference example', (WidgetTester tester) async {
// Launch the app.
await launchApp(tester);

// Enter the server URL.
await enterServerUrl(tester, 'wss://test.antmedia.io:5443/FlutterCICDtest/websocket');

// Tap the 'Conference' button.
await tester.tap(find.text('Conference'));
await tester.pumpAndSettle(const Duration(seconds: 1));

// Find the first text field and enter 'test'.
await tester.enterText(find.byType(TextField).at(0), 'test');
await tester.pumpAndSettle();

// Find the second text field and enter 'room'.
await tester.enterText(find.byType(TextField).at(1), 'room');
await tester.pumpAndSettle();

// Tap the 'Connect' button.
await tester.tap(find.text('Connect'));
await tester.pumpAndSettle(const Duration(seconds: 20));
});
}
58 changes: 58 additions & 0 deletions example/SampleProject/integration_test/test_data_channel.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:example/main.dart';
import 'package:integration_test/integration_test.dart';

void main() {
// Initialize the integration test bindings.
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

testWidgets('Runs the app, taps on the settings icon, enters the URL, and runs the Data Channel example', (WidgetTester tester) async {
// Mock initial values for shared preferences.
SharedPreferences.setMockInitialValues({});

// Launch the app.
await tester.pumpWidget(const MaterialApp(
home: Scaffold(
body: MyApp(),
)));

// Ensure the app has built.
await tester.pumpAndSettle();

// Verify the settings icon is present.
expect(find.byIcon(Icons.settings), findsOneWidget);

// Tap the settings icon.
await tester.tap(find.byIcon(Icons.settings));
await tester.pumpAndSettle();

// Check if the AlertDialog appears after tapping settings.
expect(find.byType(AlertDialog), findsOneWidget);

// Enter the server URL in the TextField inside the dialog.
await tester.enterText(find.byType(TextField), 'wss://test.antmedia.io:5443/FlutterCICDtest/websocket');
await tester.pumpAndSettle();

// Ensure the "Set Server Ip" button is present and enabled.
final setServerIpButton = find.widgetWithText(MaterialButton, 'Set Server Ip');
expect(setServerIpButton, findsOneWidget);

// Tap the "Set Server Ip" button.
await tester.tap(setServerIpButton);
await tester.pumpAndSettle();

// Verify that a SnackBar appears after setting the server IP.
expect(find.byType(SnackBar), findsOneWidget);

// Tap the 'Conference' button.
await tester.tap(find.text('Data Channel'));
await tester.pumpAndSettle();

// Enter Room ID and tap OK.
await tester.enterText(find.byType(TextField), '24x7test');
await tester.tap(find.text('OK'));
await tester.pumpAndSettle(const Duration(seconds: 5));
});
}
56 changes: 56 additions & 0 deletions example/SampleProject/integration_test/test_helper.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// test_helper.dart

import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:example/main.dart';

// A helper method to launch the app.
Future<void> launchApp(WidgetTester tester) async {

// Mock initial values for shared preferences.
SharedPreferences.setMockInitialValues({});

// Launch the app.
await tester.pumpWidget(const MaterialApp(
home: Scaffold(
body: MyApp(),
),
));
await tester.pumpAndSettle();
}

// A helper method to open settings and enter a server URL.
Future<void> enterServerUrl(WidgetTester tester, String url) async {
// Verify the settings icon is present.
expect(find.byIcon(Icons.settings), findsOneWidget);

// Tap the settings icon.
await tester.tap(find.byIcon(Icons.settings));
await tester.pumpAndSettle();

// Check if the AlertDialog appears after tapping settings.
expect(find.byType(AlertDialog), findsOneWidget);

// Enter the server URL in the TextField inside the dialog.
await tester.enterText(find.byType(TextField), url);
await tester.pumpAndSettle();

// Tap the "Set Server Ip" button.
final setServerIpButton = find.widgetWithText(MaterialButton, 'Set Server Ip');
expect(setServerIpButton, findsOneWidget);
await tester.tap(setServerIpButton);
await tester.pumpAndSettle();

// Verify that a SnackBar appears after setting the server IP.
expect(find.byType(SnackBar), findsOneWidget);
}

// A helper method to enter a Room ID and tap OK.
Future<void> enterRoomId(WidgetTester tester, String roomId) async {
await tester.enterText(find.byType(TextField), roomId);
await tester.tap(find.text('OK'));
await tester.pumpAndSettle();
}
58 changes: 58 additions & 0 deletions example/SampleProject/integration_test/test_p2p.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:example/main.dart';

void main() {
// Initialize the integration test bindings.
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

testWidgets('Runs the app, taps on the settings icon, enters the URL, and runs the Peer to Peer example', (WidgetTester tester) async {
// Mock initial values for shared preferences.
SharedPreferences.setMockInitialValues({});

// Launch the app.
await tester.pumpWidget(const MaterialApp(
home: Scaffold(
body: MyApp(),
)));

// Ensure the app has built.
await tester.pumpAndSettle();

// Verify the settings icon is present.
expect(find.byIcon(Icons.settings), findsOneWidget);

// Tap the settings icon.
await tester.tap(find.byIcon(Icons.settings));
await tester.pumpAndSettle();

// Check if the AlertDialog appears after tapping settings.
expect(find.byType(AlertDialog), findsOneWidget);

// Enter the server URL in the TextField inside the dialog.
await tester.enterText(find.byType(TextField), 'wss://test.antmedia.io:5443/FlutterCICDtest/websocket');
await tester.pumpAndSettle();

// Ensure the "Set Server Ip" button is present and enabled.
final setServerIpButton = find.widgetWithText(MaterialButton, 'Set Server Ip');
expect(setServerIpButton, findsOneWidget);

// Tap the "Set Server Ip" button.
await tester.tap(setServerIpButton);
await tester.pumpAndSettle();

// Verify that a SnackBar appears after setting the server IP.
expect(find.byType(SnackBar), findsOneWidget);

// Tap the 'Conference' button.
await tester.tap(find.text('Peer to Peer'));
await tester.pumpAndSettle();

// Enter Room ID and tap OK.
await tester.enterText(find.byType(TextField), 'p2pTest');
await tester.tap(find.text('OK'));
await tester.pumpAndSettle(const Duration(seconds: 5));
});
}
28 changes: 28 additions & 0 deletions example/SampleProject/integration_test/test_play.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'test_helper.dart';

void main() {
// Initialize the integration test bindings.
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

testWidgets('Runs the app, taps on the settings icon, enters the URL, and runs the play example', (WidgetTester tester) async {
// Launch the app.
await launchApp(tester);

// Enter the server URL.
await enterServerUrl(tester, 'wss://test.antmedia.io:5443/24x7test/websocket');

// Tap the 'Play' button.
await tester.tap(find.text('Play'));
await tester.pumpAndSettle();

// Enter Room ID and tap OK.
await enterRoomId(tester, '24x7test');
await tester.pumpAndSettle(const Duration(seconds: 10));

// Verify the content of the SnackBar.
expect(find.textContaining('Received: '), findsOneWidget);
});
}
44 changes: 44 additions & 0 deletions example/SampleProject/integration_test/test_publish.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:example/publish.dart';
import 'test_helper.dart';

void main() {

// Initialize the integration test bindings.
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

testWidgets('Runs the app, taps on the settings icon, enters the URL, and runs the Publish example', (WidgetTester tester) async {
// Launch the app.
await launchApp(tester);

// Enter the server URL.
await enterServerUrl(tester, 'wss://test.antmedia.io:5443/FlutterCICDtest/websocket');

// Tap the 'Publish' button.
await tester.tap(find.text('Publish'));
await tester.pumpAndSettle(const Duration(seconds: 2));


// Enter Room ID and tap OK.
await enterRoomId(tester, 'publishTest');

// Verify the AlertDialog to choose the publishing source appears.
expect(find.byType(AlertDialog), findsOneWidget);

// Tap the "Camera" button.
await tester.tap(find.widgetWithText(MaterialButton, 'Camera'));
await tester.pumpAndSettle(const Duration(seconds: 15));

// Verify that the Publish screen is loaded.
expect(find.byType(Publish), findsOneWidget);

// Check if the call_end icon is present and tap it if it appears.
final callEndIcon = find.byIcon(Icons.call_end);
await tester.tap(callEndIcon);
await tester.pumpAndSettle();
});
}
2 changes: 1 addition & 1 deletion example/SampleProject/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '12.0'
platform :ios, '13.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
Loading
Loading