Skip to content

Checkout v3

Checkout v3 #345

name: Integration tests
on:
push:
branches:
- '*'
tags:
- '*'
pull_request:
jobs:
test:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: shivammathur/setup-php@master
with:
php-version: '7.3'
extension: intl, mbstring, json, bcmath
coverage: xdebug
tools: composer, phpcs, php-cs-fixer, phpunit, phpcpd, phpmd
- name: PHPCS check
run: phpcs --standard=PSR2 --report=code --ignore=vendor/* --runtime-set ignore_warnings_on_exit true src/
- name: PHP Mess Detector
run: phpmd src/ text cleancode,codesize,controversial,design,naming,unusedcode --exclude vendor/
- name: Unit tests
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
PAYEE_ID: ${{ secrets.PAYEE_ID }}
ACCESS_TOKEN_MOBILEPAY: ${{ secrets.ACCESS_TOKEN_MOBILEPAY }}
PAYEE_ID_MOBILEPAY: ${{ secrets.PAYEE_ID_MOBILEPAY }}
run: |
if [ "$ACCESS_TOKEN" != "" ]; then
sed -i -e "s/~4.0/dev-main/g" ./composer.json
composer install
./vendor/bin/phpunit --configuration=./tests/phpunit.xml --bootstrap=./tests/bootstrap.php ./tests/ --coverage-clover=coverage.xml
fi
- name: Upload code coverage report to Codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: bash <(curl -s https://codecov.io/bash)
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
path: /tmp/swedbankpay.log