Skip to content

Commit 4f24d70

Browse files
committed
ci: add arch testing
1 parent 90e3068 commit 4f24d70

File tree

2 files changed

+59
-2
lines changed

2 files changed

+59
-2
lines changed

.github/workflows/testing.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,63 @@ jobs:
132132
- name: 🧪 Run unit tests using pestphp/pest
133133
run: composer test
134134

135+
arch-testing:
136+
timeout-minutes: 4
137+
runs-on: ${{ matrix.os }}
138+
concurrency:
139+
cancel-in-progress: true
140+
group: arch-testing-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.php-version }}-${{ matrix.dependencies }}
141+
strategy:
142+
fail-fast: true
143+
matrix:
144+
os:
145+
- ubuntu-latest
146+
php-version:
147+
- '8.1'
148+
dependencies:
149+
- locked
150+
steps:
151+
- name: 📦 Check out the codebase
152+
uses: actions/checkout@v4.1.6
153+
154+
- name: 🛠️ Setup PHP
155+
uses: shivammathur/setup-php@2.30.5
156+
with:
157+
php-version: ${{ matrix.php-version }}
158+
extensions: none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, opcache, pcntl, posix
159+
ini-values: error_reporting=E_ALL
160+
coverage: xdebug
161+
162+
- name: 🛠️ Setup problem matchers
163+
run: |
164+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
165+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
166+
167+
- name: 🤖 Validate composer.json and composer.lock
168+
run: composer validate --ansi --strict
169+
170+
- name: 🔍 Get composer cache directory
171+
uses: wayofdev/gh-actions/actions/composer/get-cache-directory@v3.1.0
172+
173+
- name: ♻️ Restore cached dependencies installed with composer
174+
uses: actions/cache@v4.0.2
175+
with:
176+
path: ${{ env.COMPOSER_CACHE_DIR }}
177+
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
178+
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
179+
180+
- name: ⚙️ Remove platform configuration with composer
181+
if: matrix.dependencies != 'locked'
182+
run: composer config platform.php --ansi --unset
183+
184+
- name: 📥 Install "${{ matrix.dependencies }}" dependencies
185+
uses: wayofdev/gh-actions/actions/composer/install@v3.1.0
186+
with:
187+
dependencies: ${{ matrix.dependencies }}
188+
189+
- name: 🧪 Run architecture tests using pestphp/pest
190+
run: composer test:arch
191+
135192
mutation-testing:
136193
timeout-minutes: 16
137194
runs-on: ${{ matrix.os }}

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ else
127127
endif
128128
.PHONY: env
129129

130-
prepare:
130+
prepare: ## Prepare project for development
131131
mkdir -p .build/php-cs-fixer
132132
.PHONY: prepare
133133

@@ -295,6 +295,6 @@ test-sep: ## Run project php-unit tests that requires @runInSeparateProcess anno
295295
#
296296
# Release
297297
# ------------------------------------------------------------------------------------
298-
commit:
298+
commit: ## Run commitizen to create commit message
299299
czg commit --config="./.github/.cz.config.js"
300300
.PHONY: commit

0 commit comments

Comments
 (0)