Skip to content

Commit c53645e

Browse files
Merge pull request #173 from TransactionProcessing/dummy_branch
Dummy branch
2 parents 441ae02 + 6bcb925 commit c53645e

73 files changed

Lines changed: 1572 additions & 2530 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
name: Build & Test Pull Requests UI Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
end-to-end-tests:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
platform: [android] #, ios, windows]
14+
include:
15+
- platform: android
16+
os: ubuntu-latest
17+
- platform: ios
18+
os: macos-latest
19+
- platform: windows
20+
os: windows-latest
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
##############################
27+
# Setup .NET and Dependencies
28+
##############################
29+
- name: Set up .NET
30+
uses: actions/setup-dotnet@v3
31+
with:
32+
dotnet-version: 8.0.x
33+
34+
- name: Install MAUI Workloads for Android
35+
if: matrix.platform == 'android'
36+
run: dotnet workload install android --ignore-failed-sources
37+
38+
- name: Install MAUI Workloads for iOS
39+
if: matrix.platform == 'ios'
40+
run: dotnet workload install maui --ignore-failed-sources
41+
42+
- name: Install MAUI Workloads for Windows
43+
if: matrix.platform == 'windows'
44+
run: dotnet workload install maui --ignore-failed-sources
45+
46+
###########################
47+
# 🐳 Start Backend System (Docker)
48+
###########################
49+
- name: Install Docker Desktop (macOS only)
50+
if: runner.os == 'macOS'
51+
run: |
52+
brew install docker
53+
# Install Docker daemon (Docker CLI can work with a running daemon)
54+
brew install --cask colima # Colima is a lightweight Docker alternative
55+
colima start # Start Colima which runs the Docker daemon
56+
# Wait for Docker to initialize
57+
sleep 30 # Wait for Docker to be ready
58+
docker info || (echo "Docker is not running" && exit 1)
59+
60+
- name: Set up Docker (Ubuntu)
61+
if: runner.os == 'Linux'
62+
run: |
63+
#sudo apt-get purge -y containerd.io
64+
65+
# Update package information and install Docker
66+
#sudo apt-get update
67+
#sudo apt-get install -y docker.io
68+
69+
# Enable Docker service to start on boot (in case it's required)
70+
#sudo systemctl enable --now docker
71+
72+
# Check Docker version to ensure it's installed properly
73+
docker --version
74+
docker info
75+
76+
# Allow current user to access Docker without sudo (optional, for convenience)
77+
sudo usermod -aG docker $USER
78+
79+
# Restart Docker service to apply changes
80+
sudo systemctl restart docker
81+
82+
###########################
83+
# 🛠 Install Appium & Drivers
84+
###########################
85+
- name: Install Node.js
86+
uses: actions/setup-node@v3
87+
with:
88+
node-version: 18
89+
90+
- name: Install Appium and Drivers
91+
run: |
92+
npm install -g appium
93+
appium driver install uiautomator2
94+
appium driver install xcuitest
95+
appium driver install windows
96+
97+
- name: Start Appium Server
98+
run: |
99+
nohup appium --log appium.log &
100+
101+
##############################
102+
# 🟢 Android: Start Emulator
103+
##############################
104+
- name: Install Android SDK & Start Emulator (Linux)
105+
if: matrix.platform == 'android'
106+
run: |
107+
# Install dependencies
108+
sudo apt-get update
109+
sudo apt-get install -y unzip wget libglu1-mesa
110+
111+
# Set up Android SDK directory
112+
export ANDROID_HOME=$HOME/android-sdk
113+
export PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH
114+
mkdir -p $ANDROID_HOME/cmdline-tools
115+
116+
# Download and install Android command-line tools
117+
wget -q https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -O cmdline-tools.zip
118+
unzip -q cmdline-tools.zip -d $ANDROID_HOME/cmdline-tools
119+
rm cmdline-tools.zip
120+
mv $ANDROID_HOME/cmdline-tools/cmdline-tools $ANDROID_HOME/cmdline-tools/latest
121+
122+
# Accept licenses
123+
yes | sdkmanager --licenses || true
124+
125+
# Install required Android SDK packages
126+
sdkmanager --sdk_root=$ANDROID_HOME --install "platform-tools" "emulator" "system-images;android-31;google_apis;x86_64"
127+
128+
# Verify installation
129+
sdkmanager --list | grep "system-images;android-31;google_apis;x86_64"
130+
131+
# Create and start emulator
132+
echo "no" | avdmanager create avd -n testEmulator -k "system-images;android-31;google_apis;x86_64" --device "pixel_4"
133+
134+
echo "⏳ Pausing for 10 seconds to ensure AVD registration..."
135+
sleep 30
136+
137+
# Start the emulator in the background
138+
nohup emulator -avd testEmulator -no-window -no-audio -gpu swiftshader_indirect -no-snapshot -no-boot-anim &
139+
140+
# Wait up to 5 minutes (300 seconds) for the emulator to be ready
141+
timeout=300
142+
while [[ $timeout -gt 0 ]]; do
143+
boot_status=$(adb shell getprop sys.boot_completed 2>&1)
144+
echo "Waiting for emulator... Boot status: $boot_status"
145+
if [[ "$boot_status" == "1" ]]; then
146+
echo "✅ Emulator booted successfully!"
147+
exit 0
148+
fi
149+
sleep 5
150+
((timeout -= 5))
151+
done
152+
153+
echo "❌ Emulator failed to boot within timeout!"
154+
exit 1
155+
156+
157+
##############################
158+
# 🍏 iOS: Start Simulator
159+
##############################
160+
- name: Start iOS Simulator
161+
if: matrix.platform == 'ios'
162+
run: |
163+
open -a Simulator &
164+
xcrun simctl list
165+
xcrun simctl boot "iPhone 14"
166+
xcrun simctl list devices
167+
168+
##############################
169+
# 🔨 Build .NET MAUI App
170+
##############################
171+
- name: Build MAUI App for Android
172+
if: matrix.platform == 'android'
173+
run: dotnet build TransactionMobile.Maui/TransactionMobile.Maui.csproj -f net8.0-android -c Release --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json
174+
175+
- name: Build MAUI App for iOS
176+
if: matrix.platform == 'ios'
177+
run: dotnet build TransactionMobile.Maui/TransactionMobile.Maui.csproj -f net8.0-ios -c Release --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json
178+
179+
- name: Build MAUI App for Windows
180+
if: matrix.platform == 'windows'
181+
run: dotnet build TransactionMobile.Maui/TransactionMobile.Maui.csproj -f net8.0-windows -c Release --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json
182+
183+
##############################
184+
# 🚀 Run Appium UI Tests
185+
##############################
186+
- name: Run Appium Tests (Android)
187+
if: matrix.platform == 'android'
188+
run: dotnet test TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj --filter (Category=PRTest)&(Category=Android)
189+
190+
- name: Run Appium Tests (iOS)
191+
if: matrix.platform == 'ios'
192+
run: dotnet test TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj --filter (Category=PRTest)&(Category=iOS)
193+
194+
- name: Run Appium Tests (Windows)
195+
if: matrix.platform == 'windows'
196+
run: dotnet test TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj --filter "Category=PRTest&Category=Windows"
197+
198+
##############################
199+
# 📤 Upload Logs if Tests Fail
200+
##############################
201+
- name: Upload logs if tests fail
202+
if: failure()
203+
uses: actions/upload-artifact@v4
204+
with:
205+
name: appium-logs-${{ matrix.test-type }}
206+
path: artifacts/appium-logs-${{ matrix.test-type }}.log
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# name: Build & Test Pull Requests UI Tests
2+
3+
# on:
4+
# pull_request:
5+
# branches:
6+
# - main
7+
8+
# jobs:
9+
# end-to-end-tests:
10+
# runs-on: ${{ matrix.os }}
11+
# strategy:
12+
# matrix:
13+
# platform: [android, ios, windows]
14+
# include:
15+
# - platform: android
16+
# os: ubuntu-latest
17+
# - platform: ios
18+
# os: macos-latest
19+
# - platform: windows
20+
# os: windows-latest
21+
22+
# steps:
23+
# - name: Checkout repository
24+
# uses: actions/checkout@v4
25+
26+
# ##############################
27+
# # Setup .NET and Dependencies
28+
# ##############################
29+
# - name: Set up .NET
30+
# uses: actions/setup-dotnet@v3
31+
# with:
32+
# dotnet-version: 8.0.x
33+
34+
# - name: Install MAUI Workloads
35+
# run: dotnet workload install maui
36+
37+
# ###########################
38+
# # 🛠 Install Appium & Drivers
39+
# ###########################
40+
# - name: Install Node.js
41+
# uses: actions/setup-node@v3
42+
# with:
43+
# node-version: 18
44+
45+
# - name: Install Appium and Drivers
46+
# run: |
47+
# npm install -g appium
48+
# appium driver install uiautomator2
49+
# appium driver install xcuitest
50+
# appium driver install windows
51+
52+
# - name: Start Appium Server
53+
# run: |
54+
# nohup appium --log appium.log &
55+
56+
# ##############################
57+
# # 🟢 Android: Start Emulator
58+
# ##############################
59+
# - name: Install Android SDK & Emulator
60+
# if: matrix.platform == 'android'
61+
# run: |
62+
# sudo apt update
63+
# sudo apt install -y qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils
64+
# sudo usermod -aG libvirt $USER
65+
# sudo usermod -aG kvm $USER
66+
# sdkmanager --install "system-images;android-31;default;x86_64"
67+
# echo "no" | avdmanager create avd -n testEmulator -k "system-images;android-31;default;x86_64" --device "pixel_4"
68+
# nohup emulator -avd testEmulator -no-window -no-audio -gpu swiftshader_indirect &
69+
70+
# - name: Wait for Emulator to Boot
71+
# if: matrix.platform == 'android'
72+
# run: |
73+
# adb wait-for-device
74+
# adb shell settings put global window_animation_scale 0
75+
# adb shell settings put global transition_animation_scale 0
76+
# adb shell settings put global animator_duration_scale 0
77+
# adb devices
78+
79+
# ##############################
80+
# # 🍏 iOS: Start Simulator
81+
# ##############################
82+
# - name: Start iOS Simulator
83+
# if: matrix.platform == 'ios'
84+
# run: |
85+
# open -a Simulator &
86+
# xcrun simctl list
87+
# xcrun simctl boot "iPhone 14"
88+
# xcrun simctl list devices
89+
90+
# ##############################
91+
# # 🔨 Build .NET MAUI App
92+
# ##############################
93+
# - name: Build MAUI App for Android
94+
# if: matrix.platform == 'android'
95+
# run: dotnet build TransactionMobile.Maui/TransactionMobile.Maui.csproj -f net8.0-android -c Release --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json
96+
97+
# - name: Build MAUI App for iOS
98+
# if: matrix.platform == 'ios'
99+
# run: dotnet build TransactionMobile.Maui/TransactionMobile.Maui.csproj -f net8.0-ios -c Release --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json
100+
101+
# - name: Build MAUI App for Windows
102+
# if: matrix.platform == 'windows'
103+
# run: dotnet build TransactionMobile.Maui/TransactionMobile.Maui.csproj -f net8.0-windows -c Release --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json
104+
105+
# ##############################
106+
# # 🚀 Run Appium UI Tests
107+
# ##############################
108+
# - name: Run Appium Navigation Tests (Android)
109+
# if: matrix.platform == 'android'
110+
# run: dotnet test TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj --filter (Category=PRNavTest)&(Category=Android)
111+
112+
# - name: Run Appium Navigation Hardware Tests (Android)
113+
# if: matrix.platform == 'android'
114+
# run: dotnet test TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj --filter (Category=PRHWNavTest)&(Category=Android)
115+
116+
# - name: Run Appium Tests (iOS)
117+
# if: matrix.platform == 'ios'
118+
# run: dotnet test TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj --filter (Category=PRNavTest)&(Category=iOS)
119+
120+
# - name: Run Appium Tests (Windows)
121+
# if: matrix.platform == 'windows'
122+
# run: dotnet test TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj --filter "Category=PRNavTest&Category=Windows"
123+
124+
# ##############################
125+
# # 📤 Upload Logs if Tests Fail
126+
# ##############################
127+
# - name: Upload logs if tests fail
128+
# if: failure()
129+
# uses: actions/upload-artifact@v3
130+
# with:
131+
# name: appium-logs-${{ matrix.test-type }}
132+
# path: artifacts/appium-logs-${{ matrix.test-type }}.log
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# name: Build & Test Pull Requests Unit Tests
2+
3+
# on:
4+
# pull_request:
5+
# branches:
6+
# - main
7+
8+
# env:
9+
# DOTNET_NOLOGO: true # Disable the .NET logo
10+
# DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience
11+
# DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry
12+
13+
# jobs:
14+
# unit-tests :
15+
# runs-on: ubuntu-latest
16+
# name: Android Build - Unit Tests
17+
# steps:
18+
# - name: Checkout
19+
# uses: actions/checkout@v3
20+
21+
# - name: Install MAUI Workloads
22+
# run: |
23+
# dotnet workload install android --ignore-failed-sources
24+
# dotnet workload install maui --ignore-failed-sources
25+
26+
# - name: Restore Dependencies
27+
# run: dotnet restore TransactionMobile.Maui.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json
28+
29+
# - name: Build Code
30+
# run: dotnet build TransactionMobile.Maui/TransactionMobile.Maui.csproj -c Release -f net8.0-android --no-restore
31+
32+
# - name: Run Unit Tests
33+
# run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj

0 commit comments

Comments
 (0)