Skip to content

Build

Build #31

Workflow file for this run

name: Build
on:
schedule:
- cron: '0 2 * * 0' # Weekly on Sundays at 02:00
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 --coverage-clover=coverage.xml
- if: matrix.php-version == '7.4'
name: Send clover to codecov
run: test -z "${{ secrets.CODECOV_TOKEN }}" || (bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }} -f "*.php" -Z -R .)