-
-
Notifications
You must be signed in to change notification settings - Fork 13
156 lines (137 loc) · 5.4 KB
/
ci.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
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@v4
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@v4
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