Skip to content

CI

CI #989

Workflow file for this run

name: CI
on:
schedule:
# Every sunday at 02:00
- cron: 0 2 * * 0
pull_request:
push:
branches:
- main
- '[0-9].x'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
tests:
name: Tests PHP ${{ matrix.php }} (Symfony ${{ matrix.symfony }})
runs-on: ubuntu-latest
strategy:
matrix:
php:
- '8.0'
- '8.1'
- '8.2'
symfony:
- '5.4.*'
- '6.3.*'
include:
- php: '8.2'
symfony: '6.3.*'
coverage: '--coverage-clover build/logs/phpunit/clover.xml'
bootable: true
quality: true
exclude:
# Symfony 6.3 requires PHP 8.1
- php: '8.0'
symfony: '6.3.*'
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: pcov
tools: composer:v2, flex, php-cs-fixer
- name: Install chromium
run: |
sudo apt-get update
sudo apt-get --fix-broken install
sudo apt-get install -y --no-install-recommends chromium-browser
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Configure Symfony
run: composer config extra.symfony.require "${{ matrix.symfony }}"
- name: Update project dependencies
run: composer update --no-progress --ansi --prefer-stable
- name: Bundle is bootable
if: matrix.bootable && github.event_name == 'push'
env:
SKELETON_VERSION: ${{ matrix.symfony }}
run: |
composer create-project "symfony/skeleton:${SKELETON_VERSION}" flex
cd flex
composer config extra.symfony.allow-contrib true
composer req gheb/docusign-bundle:dev-${GITHUB_REF#refs/heads/}
- name: Run php-cs-fixer tests
if: matrix.quality
run: php-cs-fixer fix --diff --dry-run
- name: Run phpstan tests
if: matrix.quality
run: vendor/bin/phpstan analyze
- name: Prepare PHPUnit tests
env:
DOCUSIGN_RSA_PASSPHRASE: ${{ secrets.DOCUSIGN_RSA_PASSPHRASE }}
run: |
mkdir -p build/screenshots build/logs/phpunit
openssl aes-256-cbc -d -a -pbkdf2 -salt -in features/var/jwt/docusign.pem.enc -out features/var/jwt/docusign.pem -pass env:DOCUSIGN_RSA_PASSPHRASE
- name: Run PHPUnit tests
env:
DOCUSIGN_INTEGRATION_KEY: ${{ secrets.DOCUSIGN_INTEGRATION_KEY }}
DOCUSIGN_USER_GUID: ${{ secrets.DOCUSIGN_USER_GUID }}
DOCUSIGN_ACCOUNT_ID: ${{ secrets.DOCUSIGN_ACCOUNT_ID }}
DOCUSIGN_CLICKWRAP_ID: ${{ secrets.DOCUSIGN_CLICKWRAP_ID }}
DOCUSIGN_API_ACCOUNT_ID: ${{ secrets.DOCUSIGN_API_ACCOUNT_ID }}
DOCUSIGN_SECRET: ${{ secrets.DOCUSIGN_SECRET }}
DOCUSIGN_DEFAULT_SIGNER_NAME: ${{ secrets.DOCUSIGN_DEFAULT_SIGNER_NAME }}
DOCUSIGN_DEFAULT_SIGNER_EMAIL: ${{ secrets.DOCUSIGN_DEFAULT_SIGNER_EMAIL }}
DOCUSIGN_EMAIL: ${{ secrets.DOCUSIGN_EMAIL }}
DOCUSIGN_PASSWORD: ${{ secrets.DOCUSIGN_PASSWORD }}
run: vendor/bin/simple-phpunit ${{ matrix.coverage }}
- name: Upload coverage artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: panther-screenshots-${{ matrix.php }}
path: screenshots
- name: Run bootable PHPUnit tests
env:
DOCUSIGN_INTEGRATION_KEY: ${{ secrets.DOCUSIGN_INTEGRATION_KEY }}
DOCUSIGN_USER_GUID: ${{ secrets.DOCUSIGN_USER_GUID }}
DOCUSIGN_ACCOUNT_ID: ${{ secrets.DOCUSIGN_ACCOUNT_ID }}
DOCUSIGN_CLICKWRAP_ID: ${{ secrets.DOCUSIGN_CLICKWRAP_ID }}
DOCUSIGN_API_ACCOUNT_ID: ${{ secrets.DOCUSIGN_API_ACCOUNT_ID }}
DOCUSIGN_SECRET: ${{ secrets.DOCUSIGN_SECRET }}
DOCUSIGN_DEFAULT_SIGNER_NAME: ${{ secrets.DOCUSIGN_DEFAULT_SIGNER_NAME }}
DOCUSIGN_DEFAULT_SIGNER_EMAIL: ${{ secrets.DOCUSIGN_DEFAULT_SIGNER_EMAIL }}
DOCUSIGN_EMAIL: ${{ secrets.DOCUSIGN_EMAIL }}
DOCUSIGN_PASSWORD: ${{ secrets.DOCUSIGN_PASSWORD }}
run: vendor/bin/simple-phpunit --group bootable
- name: Upload coverage artifacts
if: matrix.coverage != ''
uses: actions/upload-artifact@v3
with:
name: build-php${{ matrix.php }}
path: build
- name: Upload coverage results to Codecov
if: matrix.coverage != ''
uses: codecov/codecov-action@v3
with:
name: phpunit-php${{ matrix.php }}
flags: phpunit
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage results to Coveralls
if: matrix.coverage != ''
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require --prefer-dist --no-progress --ansi php-coveralls/php-coveralls
$HOME/.composer/vendor/bin/php-coveralls --coverage_clover=build/logs/phpunit/clover.xml -v