Skip to content

Commit 417fac5

Browse files
author
Manuel Ruck
committed
ci(e2e): run tests in pipeline
Signed-off-by: Manuel Ruck <[email protected]>
1 parent 3e82f1e commit 417fac5

File tree

1 file changed

+127
-0
lines changed

1 file changed

+127
-0
lines changed

.github/workflows/e2e-tests.yaml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: 🧪 E2E Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
APP_VARIANT: internal
11+
CI: true
12+
13+
jobs:
14+
e2e-test:
15+
name: Run ${{ matrix.test }} on ${{ matrix.platform }}
16+
strategy:
17+
matrix:
18+
include:
19+
# - platform: android
20+
# os: macos-latest
21+
# test: smoke
22+
# - platform: android
23+
# os: macos-latest
24+
# test: verification
25+
- platform: ios
26+
os: macos-latest
27+
test: smoke
28+
# - platform: ios
29+
# os: macos-latest
30+
# test: verification
31+
runs-on: ${{ matrix.os }}
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v4
36+
37+
- name: Set up Node.js
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: "22"
41+
42+
- name: Cache Yarn dependencies
43+
uses: actions/cache@v4
44+
with:
45+
path: node_modules
46+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
47+
restore-keys: |
48+
${{ runner.os }}-yarn-
49+
50+
- name: Install dependencies
51+
run: yarn
52+
53+
- name: Install Maestro
54+
run: |
55+
curl -Ls "https://get.maestro.mobile.dev" | bash
56+
export PATH="$PATH":"$HOME/.maestro/bin"
57+
58+
- name: Decrypt GPG secure files
59+
run: |
60+
brew install [email protected]
61+
echo ${{ secrets.SUPER_SECRET_PASSWORD }} | gpg1 --no-tty --passphrase-fd 0 google-services.json.gpg
62+
63+
- name: Build Expo app prebuild
64+
run: yarn expo prebuild --platform ${{ matrix.platform }}
65+
66+
- name: Cache iOS build
67+
uses: actions/cache@v4
68+
if: matrix.platform == 'ios'
69+
with:
70+
path: |
71+
ios/build
72+
~/Library/Developer/Xcode/DerivedData
73+
key: ${{ runner.os }}-ios-build-${{ hashFiles('ios/**/*.pbxproj', 'ios/Podfile.lock', 'src/**/*.tsx', 'src/**/*.ts') }}
74+
restore-keys: |
75+
${{ runner.os }}-ios-build-
76+
77+
- name: Setup iOS Simulator
78+
if: matrix.platform == 'ios'
79+
run: |
80+
DEVICE_ID=$(xcrun xctrace list devices | grep -m 1 "iPhone" | awk '{print $NF}' | tr -d '()')
81+
xcrun simctl boot $DEVICE_ID || true
82+
83+
# - name: Setup Android Emulator
84+
# if: matrix.platform == 'android'
85+
# uses: reactivecircus/android-emulator-runner@v2
86+
# with:
87+
# api-level: 31
88+
# script: echo "Emulator started"
89+
90+
- name: Build iOS App
91+
if: matrix.platform == 'ios'
92+
run: |
93+
xcodebuild -workspace DEMOCRACYInternal.xcworkspace -scheme DEMOCRACYInternal -configuration Release -sdk iphonesimulator -derivedDataPath build | xcbeautifier
94+
working-directory: ${{ github.workspace }}/ios
95+
96+
# - name: Install iOS App
97+
# if: matrix.platform == 'ios'
98+
# run: |
99+
# DEVICE_ID=$(xcrun xctrace list devices | grep -m 1 "iPhone" | awk '{print $NF}' | tr -d '()')
100+
# xcrun simctl install $DEVICE_ID ios/build/Build/Products/Release-iphonesimulator/DEMOCRACYInternal.app
101+
102+
# - name: Launch iOS App
103+
# if: matrix.platform == 'ios'
104+
# run: |
105+
# DEVICE_ID=$(xcrun xctrace list devices | grep -m 1 "iPhone" | awk '{print $NF}' | tr -d '()')
106+
# xcrun simctl launch $DEVICE_ID de.democracy-deutschland.clientapp.internal
107+
108+
# - name: Build and Run Android App
109+
# if: matrix.platform == 'android'
110+
# run: yarn android
111+
112+
# - name: Wait for App to be ready
113+
# run: sleep 30
114+
115+
# - name: Run Maestro Tests
116+
# run: |
117+
# export PATH="$PATH":"$HOME/.maestro/bin"
118+
# yarn test:e2e:${{ matrix.test }}
119+
120+
# - name: Upload Test Results
121+
# if: always()
122+
# uses: actions/upload-artifact@v4
123+
# with:
124+
# name: maestro-${{ matrix.test }}-${{ matrix.platform }}
125+
# path: |
126+
# .maestro/test-results
127+
# .maestro/logs

0 commit comments

Comments
 (0)