-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (65 loc) · 2.38 KB
/
phpunit.yml
File metadata and controls
78 lines (65 loc) · 2.38 KB
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
# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
name: PHPUnit
on: pull_request
permissions:
contents: read
concurrency:
group: phpunit-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
phpunit:
name: PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["8.2", "8.3", "8.4"]
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
with:
php-version: ${{ matrix.php-version }}
extensions: openssl, dom, soap
coverage: xdebug
ini-file: development
ini-values: disable_functions=
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run unit tests
env:
XDEBUG_MODE: coverage
NFS_TEST_CNPJ: "11222333000181"
NFS_SANDBOX: "true"
run: composer run test:coverage
- name: Run integration tests (only when cert secrets present)
if: ${{ env.NFSE_CLIENT_CERT_B64 != '' }}
env:
XDEBUG_MODE: debug
NFSE_CLIENT_CERT_B64: ${{ secrets.NFSE_CLIENT_CERT_B64 }}
NFSE_CLIENT_KEY_B64: ${{ secrets.NFSE_CLIENT_KEY_B64 }}
NFS_TEST_CNPJ: "11222333000181"
NFS_SANDBOX: "true"
run: composer run test:integration
- name: Upload coverage results to Coveralls
if: ${{ matrix.php-version == '8.2' }}
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: php-${{ matrix.php-version }}
run: vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml --json_path=build/logs/coveralls-upload.json -v
finish-coverage:
if: ${{ github.event.pull_request.base.ref == 'main' }}
needs: phpunit
runs-on: ubuntu-latest
steps:
- name: Let Coveralls know that all tests have finished
uses: coverallsapp/github-action@v2.3.7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true