-
-
Notifications
You must be signed in to change notification settings - Fork 398
88 lines (72 loc) · 3.14 KB
/
test-config.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
name: Package tests
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
l5-swagger-flags: ['latest', 'swagger-php-3', 'swagger-ui-3']
name: PHP ${{ matrix.php }} - ${{ matrix.l5-swagger-flags }}
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: xdebug.mode="coverage"
coverage: xdebug
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer update --no-interaction --no-progress --prefer-dist --prefer-stable
- name: Require Swagger PHP 3.*
run: composer require 'zircote/swagger-php:3.*' --no-interaction --no-update
if: matrix.l5-swagger-flags == 'swagger-php-3'
- name: Require Swagger UI 3.*
run: composer require 'swagger-api/swagger-ui:3.*' --no-interaction --no-update
if: matrix.l5-swagger-flags == 'swagger-ui-3'
- name: Prepare enviroment
run: |
sudo chown -R $USER:$USER .
sudo chmod -R g+rw .
mkdir -p tests/storage/logs/test-reports
mkdir -p vendor/orchestra/testbench-core/laravel/vendor/swagger-api
mkdir -p vendor/orchestra/testbench-core/laravel/vendor/swagger-api/swagger-ui
mkdir -p vendor/orchestra/testbench-core/laravel/vendor/swagger-api/swagger-ui/dist
sudo chown -R $USER:$USER vendor/orchestra/testbench-core/laravel/vendor/swagger-api
chmod -R 777 vendor/orchestra/testbench-core/laravel/vendor/swagger-api
- name: Prepare code climate
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
if: matrix.php == '8.3' && matrix.l5-swagger-flags == 'latest'
- name: Run test suite
run: composer run-script phpunit
- name: Publish code coverage
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: |
cp ${{github.workspace}}/tests/storage/logs/test-reports/clover.xml ${{github.workspace}}/clover.xml
./cc-test-reporter after-build -t clover --exit-code 0
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r ${{github.workspace}}/clover.xml
if: matrix.php == '8.3' && matrix.l5-swagger-flags == 'latest' && github.event_name != 'pull_request'
- name: Publish coveralls report
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cp ${{github.workspace}}/tests/storage/logs/test-reports/clover.xml ${{github.workspace}}/clover.xml
vendor/bin/php-coveralls --coverage_clover=clover.xml -v
if: matrix.php == '8.3' && matrix.l5-swagger-flags == 'latest'