Skip to content

Commit dfdfded

Browse files
committed
ci: use macos
1 parent 9a7de06 commit dfdfded

1 file changed

Lines changed: 49 additions & 30 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 49 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,9 @@ concurrency:
1313

1414
jobs:
1515
e2e:
16-
runs-on: ubuntu-latest
16+
runs-on: macos-15-intel # TODO: use ubuntu-latest once open sourced
1717
name: E2E Tests
1818

19-
services:
20-
redis-cache:
21-
image: redis:alpine
22-
ports:
23-
- 13000:6379
24-
redis-queue:
25-
image: redis:alpine
26-
ports:
27-
- 11000:6379
28-
mariadb:
29-
image: mariadb:10.6
30-
env:
31-
MYSQL_ROOT_PASSWORD: root
32-
ports:
33-
- 3306:3306
34-
options: --health-cmd="mariadb-admin ping" --health-interval=5s --health-timeout=2s --health-retries=3
35-
3619
steps:
3720
- name: Clone
3821
uses: actions/checkout@v4
@@ -51,6 +34,43 @@ jobs:
5134
- name: Add to Hosts
5235
run: echo "127.0.0.1 meet.test" | sudo tee -a /etc/hosts
5336

37+
- name: Install System Dependencies
38+
run: |
39+
brew install coreutils redis mariadb
40+
41+
- name: Start Redis Servers
42+
run: |
43+
# Start Redis for cache on port 13000
44+
redis-server --port 13000 --daemonize yes
45+
# Start Redis for queue on port 11000
46+
redis-server --port 11000 --daemonize yes
47+
# Verify Redis servers are running
48+
redis-cli -p 13000 ping
49+
redis-cli -p 11000 ping
50+
51+
- name: Start MariaDB
52+
run: |
53+
# Start MariaDB
54+
brew services start mariadb
55+
# Wait for MariaDB to be ready
56+
for i in {1..30}; do
57+
if mysqladmin ping --silent 2>/dev/null; then
58+
echo "MariaDB is ready!"
59+
break
60+
fi
61+
echo "Waiting for MariaDB... ($i/30)"
62+
sleep 2
63+
done
64+
# Configure root user for password authentication
65+
mysql -u root <<EOF
66+
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
67+
CREATE USER IF NOT EXISTS 'root'@'127.0.0.1' IDENTIFIED BY 'root';
68+
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
69+
GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' WITH GRANT OPTION;
70+
FLUSH PRIVILEGES;
71+
EOF
72+
echo "MariaDB configured!"
73+
5474
- name: Cache pip
5575
uses: actions/cache@v4
5676
with:
@@ -79,20 +99,19 @@ jobs:
7999
restore-keys: |
80100
${{ runner.os }}-playwright-
81101
82-
- name: Install MariaDB Client and FFmpeg
102+
- name: Install Additional Dependencies
83103
run: |
84-
sudo apt update
85-
sudo apt-get install -y mariadb-client ffmpeg
104+
brew install ffmpeg
86105
87106
- name: Setup Bench
88107
run: |
89108
pip install frappe-bench
90109
bench init --skip-redis-config-generation --skip-assets --python "$(which python)" ~/frappe-bench
91-
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL character_set_server = 'utf8mb4'"
92-
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'"
110+
mysql --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL character_set_server = 'utf8mb4'"
111+
mysql --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'"
93112
94113
- name: Install Meet
95-
working-directory: /home/runner/frappe-bench
114+
working-directory: /Users/runner/frappe-bench
96115
run: |
97116
bench get-app meet $GITHUB_WORKSPACE
98117
bench setup requirements --dev
@@ -103,7 +122,7 @@ jobs:
103122
CI: "Yes"
104123

105124
- name: Configure Site for E2E
106-
working-directory: /home/runner/frappe-bench
125+
working-directory: /Users/runner/frappe-bench
107126
run: |
108127
bench --site meet.test set-config sfu_secret "e2e-test-secret-key-12345"
109128
bench --site meet.test set-config sfu_server_url "http://localhost"
@@ -137,21 +156,21 @@ jobs:
137156
ffmpeg -f lavfi -i testsrc=size=640x480:rate=30 -t 10 -pix_fmt yuv420p fake-video.y4m
138157
139158
- name: Start Frappe Server
140-
working-directory: /home/runner/frappe-bench
159+
working-directory: /Users/runner/frappe-bench
141160
run: |
142-
sed -i 's/^watch:/# watch:/g' Procfile
143-
sed -i 's/^schedule:/# schedule:/g' Procfile
161+
sed -i '' 's/^watch:/# watch:/g' Procfile
162+
sed -i '' 's/^schedule:/# schedule:/g' Procfile
144163
bench start &> bench_start.log &
145164
echo "Waiting for Frappe server to start..."
146-
timeout 60 bash -c 'until curl -s http://meet.test:8000 > /dev/null; do sleep 2; done'
165+
gtimeout 60 bash -c 'until curl -s http://meet.test:8000 > /dev/null; do sleep 2; done' || timeout 60 bash -c 'until curl -s http://meet.test:8000 > /dev/null; do sleep 2; done'
147166
echo "Frappe server is ready!"
148167
149168
- name: Start SFU Server
150169
working-directory: ${{ github.workspace }}/sfu-server
151170
run: |
152171
npm start &
153172
echo "Waiting for SFU server..."
154-
timeout 30 bash -c 'until curl -s http://localhost:3000/health > /dev/null 2>&1; do sleep 2; done'
173+
gtimeout 30 bash -c 'until curl -s http://localhost:3000/health > /dev/null 2>&1; do sleep 2; done' || timeout 30 bash -c 'until curl -s http://localhost:3000/health > /dev/null 2>&1; do sleep 2; done'
155174
echo "SFU server is ready"
156175
env:
157176
PORT: 3000

0 commit comments

Comments
 (0)