-
-
Notifications
You must be signed in to change notification settings - Fork 118
82 lines (70 loc) · 2.4 KB
/
blaze-tests.yml
File metadata and controls
82 lines (70 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# This workflow runs tests for the app using a similar setup as the CircleCI config.
name: Blaze Tests
# Trigger on any pull request
# and on pushes to the master branch
on:
push:
branches:
- master
pull_request:
jobs:
test-app:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Setup Node.js environment
uses: actions/setup-node@v6
with:
node-version: 22
- name: Install Meteor
run: |
npx meteor@latest
echo "$HOME/.meteor" >> $GITHUB_PATH
- name: Link packages directory
run: ln -sfn ../packages ./packages
working-directory: test-app
- name: Meteor npm install
run: meteor npm install
working-directory: test-app
- name: Start meteor test-packages (background)
run: |
export URL='http://localhost:4096/'
meteor test-packages --driver-package test-in-console -p 4096 --exclude "${TEST_PACKAGES_EXCLUDE:-}" > /tmp/meteor_test_output.log 2>&1 &
echo $! > /tmp/meteor_test_pid
working-directory: test-app
# Wait for test-in-console to be ready for up to 6 minutes
# in order to accommodate slower CI environments
- name: Wait for test-in-console to be ready
run: |
for i in {1..360}; do
if grep -q 'test-in-console listening' /tmp/meteor_test_output.log; then
echo "test-in-console is ready."
break
fi
echo "Waiting for test-in-console... attempt $i"
sleep 1
done
# Fail if the service didn't start
if ! grep -q 'test-in-console listening' /tmp/meteor_test_output.log; then
echo "test-in-console did not start in time."
cat /tmp/meteor_test_output.log # Print the log for debugging
exit 1
fi
shell: bash
working-directory: test-app
- name: Run puppeteerRunner.js
run: meteor node puppeteerRunner.js
env:
URL: http://localhost:4096/
working-directory: test-app
- name: Kill meteor test-packages process
if: always()
run: |
if [ -f /tmp/meteor_test_pid ]; then
pkill -TERM -P $(cat /tmp/meteor_test_pid)
fi
shell: bash
working-directory: test-app