-
Notifications
You must be signed in to change notification settings - Fork 10
49 lines (49 loc) · 1.36 KB
/
build.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
name: Build
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
php_unit_test:
runs-on: ubuntu-latest
name: PHP Unit Test with PHP version ${{ matrix.php-version }}
strategy:
matrix:
php-version:
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
steps:
- name: Install php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: dom, mbstring
coverage: xdebug
- name: Checkout SDK
uses: actions/checkout@v1
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer Downloads
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
run: composer install
- name: Update environment file
run: |
cp .env.php.example .env.php
sed -i "s/'API_KEY' => ''/'API_KEY' => '${{ secrets.API_KEY }}'/g" .env.php
- name: Run PHPUnit tests
run: vendor/bin/phpunit