Skip to content

Commit f3fc3b5

Browse files
authored
Setup integration tests
1 parent de33b9c commit f3fc3b5

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed

.github/workflows/tests.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "Tests"
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "1.x"
10+
11+
concurrency:
12+
group: tests-${{ github.head_ref || github.run_id }} # will be canceled on subsequent pushes in pull requests but not branches
13+
cancel-in-progress: true
14+
15+
jobs:
16+
tests-integration:
17+
name: "Integration tests"
18+
runs-on: "ubuntu-latest"
19+
timeout-minutes: 30
20+
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
extension-name:
26+
- "phpstan-doctrine"
27+
#- "phpstan-phpunit"
28+
#- "phpstan-mockery"
29+
#- "phpstan-symfony"
30+
#- "phpstan-nette"
31+
#- "phpstan-webmozart-assert"
32+
#- "phpstan-beberlei-assert"
33+
#- "phpstan-deprecation-rules"
34+
#- "phpstan-dibi"
35+
#- "phpstan-strict-rules"
36+
#- "phpstan-src"
37+
38+
steps:
39+
- name: "Checkout extension"
40+
uses: actions/checkout@v5
41+
with:
42+
repository: "phpstan/${{ matrix.extension-name }}"
43+
44+
- name: "Checkout build-infection"
45+
uses: actions/checkout@v5
46+
with:
47+
path: "build-infection"
48+
49+
- name: "Install PHP"
50+
uses: "shivammathur/setup-php@v2"
51+
with:
52+
coverage: "pcov"
53+
php-version: "8.3"
54+
tools: "infection:0.31.7"
55+
56+
- name: "Install build-infection dependencies"
57+
working-directory: "build-infection"
58+
run: "composer install --no-interaction --no-progress"
59+
60+
- name: "Install dependencies"
61+
run: "composer install --no-interaction --no-progress"
62+
63+
- name: "Configure infection"
64+
run: |
65+
php build-infection/bin/infection-config.php \
66+
> infection.json5
67+
cat infection.json5 | jq
68+
69+
- name: "Cache Result cache"
70+
uses: actions/cache@v4
71+
with:
72+
path: ./tmp
73+
key: "result-cache-v1-${{ matrix.extension-name }}-${{ github.run_id }}"
74+
restore-keys: |
75+
result-cache-v1-${{ matrix.extension-name }}-
76+
77+
- name: "Run infection"
78+
run: |
79+
infection \
80+
--ignore-msi-with-no-mutations \
81+
--log-verbosity=all \
82+
--debug \
83+
--logger-text=php://stdout

0 commit comments

Comments
 (0)