-
Notifications
You must be signed in to change notification settings - Fork 15
112 lines (96 loc) · 3.41 KB
/
php.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
name: PHP Composer
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: shivammathur/[email protected]
with:
php-version: 8.0
extensions: xdebug
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md
- name: Run test suite
run: composer run-script test
- name: upload coverage
run: bash <(curl -s https://codecov.io/bash)
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: shivammathur/[email protected]
with:
php-version: 8.0
extensions: xdebug
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md
- name: Run test suite
run: composer run-script lint
integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: shivammathur/[email protected]
with:
php-version: 8.0
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache-dist
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install composer dependencies
if: steps.composer-cache-dist.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest --no-dev
- name: Install logger
run: composer require monolog/monolog
- name: Install Dapr
run: wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash -s 1.0.0-rc.4
- name: Initialize Integration Environment
run: composer run-script dapr-init
- name: Integration Environment Logs
run: |
composer run-script start &
- name: Wait for environment
run: sleep 10
- name: Execute Tests
run: |
STATUSCODE=$(curl --silent --output /dev/stderr --write-out "%{http_code}" http://localhost:9502/do_tests)
if test $STATUSCODE -ne 200; then
exit 1
fi