-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (105 loc) · 3.45 KB
/
unit-tests.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
name: Continuous Integration Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
composer-install:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: vendor/
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-versions }}
extensions: zip
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
strategy:
max-parallel: 3
matrix:
php-versions: [ '8.1', '8.2' ]
woopie-unit:
needs:
- composer-install
runs-on: ubuntu-22.04
strategy:
max-parallel: 3
matrix:
php-versions: [ '8.1', '8.2' ]
steps:
- uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-versions }}
extensions: pgsql, zip, gd
- name: Cache PHP vendor directory
uses: actions/cache@v3
with:
path: vendor/
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: use .env.ci
run: cp .env.ci .env.local
- name: Execute tests (Unit and Feature)
run: ./vendor/bin/phpunit --testsuite "Woopie Unit Test Suite" --log-junit=report-unit.xml --coverage-html=./coverage --coverage-clover=coverage.xml
# - name: 'Comment PR'
# uses: actions/github-script@v6
# if: github.event_name == 'pull_request'
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# debug: true
# script: |
# const script = require('.github/scripts/comment-updater.js');
# script({github, context, core, filename:"phpunit.out"});
woopie-functional:
needs:
- composer-install
runs-on: ubuntu-20.04
strategy:
max-parallel: 3
matrix:
php-versions: [ '8.1', '8.2' ]
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: ci_db_test
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-versions }}
extensions: xdebug, pgsql, zip, gd
- name: Cache PHP vendor directory
uses: actions/cache@v3
with:
path: vendor/
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: use .env.ci
run: cp .env.ci .env.local
- name: Execute tests
run: ./vendor/bin/phpunit --testsuite "Woopie Functional Test Suite" --log-junit=report-functional.xml --coverage-html=./coverage --coverage-clover=coverage.xml
# - name: 'Comment PR'
# uses: actions/github-script@v6
# if: github.event_name == 'pull_request'
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# debug: true
# script: |
# const script = require('.github/scripts/comment-updater.js');
# script({github, context, core, filename:"phpunit.out"});