Skip to content

tests

tests #136

Workflow file for this run

name: tests
on:
push:
branches:
- master
tags-ignore:
- '**'
pull_request:
schedule:
- cron: '0 0 * * 0' # once in a week, docs: <https://git.io/JvxXE#onschedule>
jobs: # Docs: <https://git.io/JvxXE>
php:
name: PHP ${{ matrix.php }}, ${{ matrix.setup }} setup
runs-on: ubuntu-20.04
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
setup: [basic, lowest]
php: ['7.3', '7.4', '8.0']
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 # Action page: <https://github.com/shivammathur/setup-php>
with:
php-version: ${{ matrix.php }}
extensions: mbstring
- name: Get Composer Cache Directory # Docs: <https://git.io/JfAKn#php---composer>
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies # Docs: <https://git.io/JfAKn#php---composer>
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.setup }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install lowest Composer dependencies
if: matrix.setup == 'lowest'
run: composer update --prefer-dist --no-suggest --prefer-lowest --ansi
- name: Install basic Composer dependencies
if: matrix.setup == 'basic'
run: composer update --prefer-dist --no-suggest --ansi
- name: Show most important packages versions
run: composer info | grep -e illuminate -e phpunit -e phpstan
- name: Execute tests with code coverage
env:
XDEBUG_MODE: coverage
run: composer test-cover
- uses: codecov/codecov-action@v1 # Docs: <https://github.com/codecov/codecov-action>
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./sdk/php/coverage/clover.xml
flags: php
fail_ci_if_error: false
js:
name: JS tests
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Setup NodeJS
uses: actions/setup-node@v1 # Action page: <https://github.com/actions/setup-node>
with:
node-version: '12'
- name: Install dependencies
run: yarn install
# @todo: write tests
#- name: Execute tests
# run: yarn test
lint-changelog:
name: Lint changelog file
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Lint changelog file
uses: docker://avtodev/markdown-lint:v1 # Action page: <https://github.com/avto-dev/markdown-lint>
with:
rules: '/lint/rules/changelog.js'
config: '/lint/config/changelog.yml'
args: './CHANGELOG.md'