Skip to content

Commit 7d1a129

Browse files
CopilotManAnRuck
andcommitted
Fix GitHub Actions workflow syntax error with matrix context
Co-authored-by: ManAnRuck <[email protected]>
1 parent a45e0f2 commit 7d1a129

File tree

2 files changed

+93
-12
lines changed

2 files changed

+93
-12
lines changed

.github/workflows/e2e-tests.yaml

Lines changed: 93 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 🧪 E2E Tests
22

33
on:
44
push:
5-
branches: [main, copilot/fix-09ebd978-bbd0-4c56-983d-b3e9ca6dda0f] # Temporarily added this branch for testing
5+
branches: [main]
66
workflow_dispatch:
77
inputs:
88
test_type:
@@ -29,8 +29,95 @@ env:
2929
CI: true
3030

3131
jobs:
32-
e2e-test:
33-
name: Run ${{ matrix.test }} on ${{ matrix.platform }}
32+
# Job for automatic push triggers (only iOS smoke test)
33+
e2e-test-auto:
34+
name: Run smoke on ios (auto)
35+
runs-on: macos-latest
36+
if: github.event_name == 'push'
37+
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@v4
41+
42+
- name: Set up Node.js
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: "22"
46+
47+
- name: Cache Yarn dependencies
48+
uses: actions/cache@v4
49+
with:
50+
path: node_modules
51+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
52+
restore-keys: |
53+
${{ runner.os }}-yarn-
54+
55+
- name: Install dependencies
56+
run: yarn
57+
58+
- name: Install Maestro
59+
run: |
60+
curl -Ls "https://get.maestro.mobile.dev" | bash
61+
export PATH="$PATH":"$HOME/.maestro/bin"
62+
63+
- name: Decrypt GPG secure files
64+
run: |
65+
brew install [email protected]
66+
echo ${{ secrets.SUPER_SECRET_PASSWORD }} | gpg1 --no-tty --passphrase-fd 0 google-services.json.gpg
67+
68+
- name: Build Expo app prebuild
69+
run: yarn expo prebuild --platform ios
70+
71+
- name: Cache iOS build
72+
uses: actions/cache@v4
73+
with:
74+
path: |
75+
ios/build
76+
~/Library/Developer/Xcode/DerivedData
77+
key: ${{ runner.os }}-ios-build-${{ hashFiles('ios/**/*.pbxproj', 'ios/Podfile.lock', 'src/**/*.tsx', 'src/**/*.ts') }}
78+
restore-keys: |
79+
${{ runner.os }}-ios-build-
80+
81+
- name: Setup iOS Simulator
82+
run: |
83+
DEVICE_ID=$(xcrun xctrace list devices | grep -m 1 "iPhone" | awk '{print $NF}' | tr -d '()')
84+
xcrun simctl boot $DEVICE_ID || true
85+
86+
- name: Build iOS App
87+
run: |
88+
xcodebuild -workspace DEMOCRACYInternal.xcworkspace -scheme DEMOCRACYInternal -configuration Release -sdk iphonesimulator -derivedDataPath build | xcbeautify
89+
working-directory: ${{ github.workspace }}/ios
90+
91+
- name: Install iOS App
92+
run: |
93+
DEVICE_ID=$(xcrun xctrace list devices | grep -m 1 "iPhone" | awk '{print $NF}' | tr -d '()')
94+
xcrun simctl install $DEVICE_ID ios/build/Build/Products/Release-iphonesimulator/DEMOCRACYInternal.app
95+
96+
- name: Launch iOS App
97+
run: |
98+
DEVICE_ID=$(xcrun xctrace list devices | grep -m 1 "iPhone" | awk '{print $NF}' | tr -d '()')
99+
xcrun simctl launch $DEVICE_ID de.democracy-deutschland.clientapp.internal
100+
101+
- name: Wait for App to be ready
102+
run: sleep 30
103+
104+
- name: Run Maestro Tests
105+
run: |
106+
export PATH="$PATH":"$HOME/.maestro/bin"
107+
yarn test:e2e:smoke
108+
109+
- name: Upload Test Results
110+
if: always()
111+
uses: actions/upload-artifact@v4
112+
with:
113+
name: maestro-smoke-ios-auto
114+
path: |
115+
.maestro/test-results
116+
.maestro/logs
117+
118+
# Job for manual workflow dispatch triggers
119+
e2e-test-manual:
120+
name: Run ${{ matrix.test }} on ${{ matrix.platform }} (manual)
34121
strategy:
35122
matrix:
36123
include:
@@ -51,10 +138,9 @@ jobs:
51138
# test: verification
52139
runs-on: ${{ matrix.os }}
53140
if: |
54-
(github.event_name == 'push' && matrix.test == 'smoke' && matrix.platform == 'ios') ||
55-
(github.event_name == 'workflow_dispatch' &&
56-
((inputs.test_type == 'all') || (inputs.test_type == matrix.test)) &&
57-
((inputs.platform == 'both') || (inputs.platform == matrix.platform)))
141+
github.event_name == 'workflow_dispatch' &&
142+
((inputs.test_type == 'all') || (inputs.test_type == matrix.test)) &&
143+
((inputs.platform == 'both') || (inputs.platform == matrix.platform))
58144
59145
steps:
60146
- name: Checkout repository

temp-test-trigger.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)