1+ name : Tests
2+
3+ on :
4+ push :
5+ workflow_dispatch :
6+ concurrency :
7+ group : ${{ github.workflow }}-${{ github.ref }}
8+ cancel-in-progress : true
9+ defaults :
10+ run :
11+ shell : bash
12+
13+ jobs :
14+ tests :
15+ name : Integration and Unit tests
16+ runs-on : ubuntu-latest
17+ strategy :
18+ max-parallel : 1
19+ fail-fast : true
20+ matrix :
21+ php : [5.6, 7.0, 7.1, 7.2, 7.3, 7.4]
22+ env :
23+ PUBLISH_KEY : ${{ secrets.PUBLISH_KEY }}
24+ SUBSCRIBE_KEY : ${{ secrets.SUBSCRIBE_KEY }}
25+ SECRET_KEY : ${{ secrets.SECRET_KEY }}
26+ PUBLISH_PAM_KEY : ${{ secrets.PUBLISH_PAM_KEY }}
27+ SUBSCRIBE_PAM_KEY : ${{ secrets.SUBSCRIBE_PAM_KEY }}
28+ SECRET_PAM_KEY : ${{ secrets.SECRET_PAM_KEY }}
29+ UUID_MOCK : " test-user"
30+ steps :
31+ - name : Checkout project
32+ uses : actions/checkout@v3
33+ - name : Checkout actions
34+ uses : actions/checkout@v3
35+ with :
36+ repository : pubnub/client-engineering-deployment-tools
37+ ref : v1
38+ token : ${{ secrets.GH_TOKEN }}
39+ path : .github/.release/actions
40+ - name : Determine composer cache directory
41+ id : composer-cache-dir
42+ run : echo "dir=$(composer config cache-dir)" >> $GITHUB_OUTPUT
43+ - name : Cache Composer
44+ uses : actions/cache@v3
45+ with :
46+ path : |
47+ "${{ steps.composer-cache-dir.outputs.dir }}"
48+ ${{ github.workspace }}/vendor
49+ key : ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
50+ restore-keys : |
51+ ${{ runner.os }}-composer-
52+ - name : Setup PHP ${{ matrix.php }}
53+ uses : shivammathur/setup-php@v2
54+ with :
55+ php-version : ${{ matrix.php }}
56+ tools : phpunit
57+ coverage : none
58+ - name : Setup dependencies
59+ run : |
60+ composer self-update && composer --version
61+ composer install --prefer-dist
62+ - name : Run unit tests
63+ run : vendor/bin/phpunit --verbose
64+ - name : Cancel workflow runs for commit on error
65+ if : failure()
66+ uses : ./.github/.release/actions/actions/utils/fast-jobs-failure
67+ all-tests :
68+ name : Tests
69+ runs-on : ubuntu-latest
70+ needs : [tests]
71+ steps :
72+ - name : Tests summary
73+ run : echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed"
0 commit comments