Skip to content

Commit 8c79f93

Browse files
authored
Update tests.yml
1 parent 58a8564 commit 8c79f93

File tree

1 file changed

+43
-143
lines changed

1 file changed

+43
-143
lines changed

.github/workflows/tests.yml

Lines changed: 43 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
1-
name: CI
1+
name: run-tests
22

33
on:
44
push:
5-
branches: [ master, develop ]
5+
branches: [main, master]
66
pull_request:
7-
branches: [ master, develop ]
7+
branches: [main, master]
88

99
jobs:
1010
test:
11-
runs-on: ubuntu-latest
11+
runs-on: ${{ matrix.os }}
1212
strategy:
13-
fail-fast: false
13+
fail-fast: true
1414
matrix:
15+
os: [ubuntu-latest]
1516
php: [8.2, 8.3]
1617
laravel: [10.*, 11.*, 12.*]
17-
dependency-version: [prefer-lowest, prefer-stable]
18+
stability: [prefer-lowest, prefer-stable]
1819
include:
19-
- laravel: 10.*
20-
testbench: 8.*
20+
- laravel: 12.*
21+
testbench: 9.*
2122
- laravel: 11.*
2223
testbench: 9.*
23-
- laravel: 12.*
24-
testbench: 10.*
24+
- laravel: 10.*
25+
testbench: 8.*
2526

26-
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
27+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2728

2829
services:
2930
rabbitmq:
30-
image: rabbitmq:3.12-management-alpine
31+
image: rabbitmq:3.8-management-alpine
3132
env:
3233
RABBITMQ_DEFAULT_USER: guest
3334
RABBITMQ_DEFAULT_PASS: guest
@@ -41,135 +42,34 @@ jobs:
4142
--health-retries 5
4243
4344
steps:
44-
- name: Checkout code
45-
uses: actions/checkout@v4
46-
47-
- name: Setup PHP
48-
uses: shivammathur/setup-php@v2
49-
with:
50-
php-version: ${{ matrix.php }}
51-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
52-
coverage: none
53-
54-
- name: Setup problem matchers
55-
run: |
56-
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
57-
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
58-
59-
- name: Install dependencies
60-
run: |
61-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
62-
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
63-
64-
- name: List Installed Dependencies
65-
run: composer show -D
66-
67-
- name: Wait for RabbitMQ
68-
run: |
69-
timeout 60s bash -c 'until nc -z localhost 5672; do sleep 1; done'
70-
sleep 5
71-
72-
- name: Execute tests
73-
run: vendor/bin/phpunit
74-
env:
75-
RABBITMQ_HOST: localhost
76-
RABBITMQ_PORT: 5672
77-
RABBITMQ_USER: guest
78-
RABBITMQ_PASSWORD: guest
79-
RABBITMQ_VHOST: /
80-
81-
code-style:
82-
runs-on: ubuntu-latest
83-
name: Code Style
84-
85-
steps:
86-
- name: Checkout code
87-
uses: actions/checkout@v4
88-
89-
- name: Setup PHP
90-
uses: shivammathur/setup-php@v2
91-
with:
92-
php-version: 8.2
93-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
94-
coverage: none
95-
96-
- name: Install dependencies
97-
run: composer install --no-interaction --prefer-dist
98-
99-
- name: Check code style
100-
run: vendor/bin/pint --test
101-
102-
static-analysis:
103-
runs-on: ubuntu-latest
104-
name: Static Analysis
105-
106-
steps:
107-
- name: Checkout code
108-
uses: actions/checkout@v4
109-
110-
- name: Setup PHP
111-
uses: shivammathur/setup-php@v2
112-
with:
113-
php-version: 8.2
114-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
115-
coverage: none
116-
117-
- name: Install dependencies
118-
run: composer install --no-interaction --prefer-dist
119-
120-
- name: Run static analysis
121-
run: vendor/bin/phpstan analyse --memory-limit=2G
122-
123-
coverage:
124-
runs-on: ubuntu-latest
125-
name: Coverage
126-
127-
services:
128-
rabbitmq:
129-
image: rabbitmq:3.12-management-alpine
45+
- name: Checkout code
46+
uses: actions/checkout@v4
47+
48+
- name: Setup PHP
49+
uses: shivammathur/setup-php@v2
50+
with:
51+
php-version: ${{ matrix.php }}
52+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
53+
coverage: none
54+
55+
- name: Setup problem matchers
56+
run: |
57+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
58+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
59+
60+
- name: Install dependencies
61+
run: |
62+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
63+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
64+
65+
- name: List Installed Dependencies
66+
run: composer show -D
67+
68+
- name: Execute tests
69+
run: vendor/bin/phpunit
13070
env:
131-
RABBITMQ_DEFAULT_USER: guest
132-
RABBITMQ_DEFAULT_PASS: guest
133-
ports:
134-
- 5672:5672
135-
- 15672:15672
136-
options: >-
137-
--health-cmd "rabbitmq-diagnostics -q ping"
138-
--health-interval 10s
139-
--health-timeout 5s
140-
--health-retries 5
141-
142-
steps:
143-
- name: Checkout code
144-
uses: actions/checkout@v4
145-
146-
- name: Setup PHP
147-
uses: shivammathur/setup-php@v2
148-
with:
149-
php-version: 8.2
150-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
151-
coverage: xdebug
152-
153-
- name: Install dependencies
154-
run: composer install --no-interaction --prefer-dist
155-
156-
- name: Wait for RabbitMQ
157-
run: |
158-
timeout 60s bash -c 'until nc -z localhost 5672; do sleep 1; done'
159-
sleep 5
160-
161-
- name: Run tests with coverage
162-
run: vendor/bin/phpunit --coverage-clover=coverage.xml
163-
env:
164-
RABBITMQ_HOST: localhost
165-
RABBITMQ_PORT: 5672
166-
RABBITMQ_USER: guest
167-
RABBITMQ_PASSWORD: guest
168-
RABBITMQ_VHOST: /
169-
170-
- name: Upload coverage reports to Codecov
171-
uses: codecov/codecov-action@v3
172-
with:
173-
token: ${{ secrets.CODECOV_TOKEN }}
174-
files: ./coverage.xml
175-
fail_ci_if_error: true
71+
RABBITMQ_HOST: localhost
72+
RABBITMQ_PORT: 5672
73+
RABBITMQ_USER: guest
74+
RABBITMQ_PASSWORD: guest
75+
RABBITMQ_VHOST: /

0 commit comments

Comments
 (0)