-
Notifications
You must be signed in to change notification settings - Fork 310
59 lines (49 loc) · 1.65 KB
/
test.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
name: Tests
on:
pull_request:
push:
branches: [ master, main ]
jobs:
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
php: [7.3, 7.4, 8.0, 8.1]
stability: [prefer-lowest, prefer-stable]
name: PHP ${{ matrix.php }} - ${{ matrix.stability }} Test
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, sodium
coverage: none
tools: composer:v2
- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
- name: Run lint
run: ./vendor/bin/phplint ./ --exclude=vendor
- name: Run unit tests
run: composer exec phpunit tests/unit
- uses: actions/checkout@v2
with:
repository: pusher/public_actions
path: .github/actions
- uses: ./.github/actions/install-pusher-cli
- name: Run acceptance tests
env:
PUSHERAPP_APPID: ${{ secrets.CI_APP_ID }}
PUSHERAPP_AUTHKEY: ${{ secrets.CI_APP_KEY }}
PUSHERAPP_SECRET: ${{ secrets.CI_APP_SECRET }}
PUSHERAPP_CLUSTER: ${{ secrets.CI_APP_CLUSTER }}
PUSHER_API_KEY: ${{ secrets.CI_API_KEY }}
run: |
echo "$PUSHER_API_KEY" | pusher login
export TEST_CHANNEL="test-${RANDOM}-${RANDOM}"
echo $TEST_CHANNEL
pusher channels apps subscribe --app-id "$PUSHERAPP_APPID" --channel $TEST_CHANNEL &
sleep 5
composer exec phpunit tests/acceptance