-
-
Notifications
You must be signed in to change notification settings - Fork 433
89 lines (75 loc) · 2.74 KB
/
emulator-tests.yml
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
83
84
85
86
87
88
89
name: Emulator Tests
on:
pull_request:
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/emulator-tests.yml'
- 'composer.json'
push:
branches: ['7.x']
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/emulator-tests.yml'
- 'composer.json'
workflow_dispatch:
jobs:
emulator-tests:
name: Emulator Tests
runs-on: ubuntu-latest
env:
php-version: '8.3'
extensions: ctype, dom, grpc, json, mbstring, openssl, xml, zip, zlib
key: cache-emulators-7x-${{ matrix.php }}-v1
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ env.php-version }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Cache extensions
uses: actions/[email protected]
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.php-version }}
extensions: ${{ env.extensions }}
tools: composer, pecl
coverage: xdebug
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- uses: "ramsey/composer-install@v3"
- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Set Up Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Firebase Tools
run: npm install -g firebase-tools
- name: Run emulated Integration Tests
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
TEST_FIREBASE_APP_ID: ${{secrets.TEST_FIREBASE_APP_ID}}
TEST_FIREBASE_RTDB_URI: ${{secrets.TEST_FIREBASE_RTDB_URI}}
TEST_FIREBASE_TENANT_ID: ${{secrets.TEST_FIREBASE_TENANT_ID}}
TEST_REGISTRATION_TOKENS: ${{secrets.TEST_REGISTRATION_TOKENS}}
FIREBASE_DATABASE_EMULATOR_HOST: localhost:9100
FIREBASE_AUTH_EMULATOR_HOST: localhost:9099
XDEBUG_MODE: coverage
run: firebase emulators:exec --only auth,database --project beste-firebase 'XDEBUG_MODE=coverage vendor/bin/phpunit --group=emulator --coverage-clover=coverage.xml --log-junit=test-report.xml'
- name: Upload code coverage
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: emulator
if: github.repository_owner == 'kreait'