Skip to content

Commit 9eb4d60

Browse files
committed
Add a starter github action
1 parent fb7c125 commit 9eb4d60

File tree

1 file changed

+116
-0
lines changed

1 file changed

+116
-0
lines changed

.github/workflows/build.yaml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: "build"
2+
on:
3+
push:
4+
branches:
5+
- "master"
6+
pull_request: ~
7+
workflow_dispatch: ~
8+
9+
jobs:
10+
coding-standards:
11+
name: "Coding Standards"
12+
13+
runs-on: "ubuntu-latest"
14+
15+
strategy:
16+
matrix:
17+
php-version:
18+
- "8.0"
19+
20+
dependencies:
21+
- "highest"
22+
23+
steps:
24+
- name: "Checkout"
25+
uses: "actions/checkout@v3"
26+
27+
- name: "Setup PHP, with composer and extensions"
28+
uses: "shivammathur/setup-php@v2"
29+
with:
30+
php-version: "${{ matrix.php-version }}"
31+
extensions: "${{ env.PHP_EXTENSIONS }}"
32+
coverage: "none"
33+
34+
- name: "Install composer dependencies"
35+
uses: "ramsey/composer-install@v2"
36+
with:
37+
dependency-versions: "${{ matrix.dependencies }}"
38+
39+
- name: "Validate composer"
40+
run: "composer validate --strict"
41+
42+
- name: "Check composer normalized"
43+
run: "composer normalize --dry-run"
44+
45+
# - name: "Check style"
46+
# run: "composer check-style"
47+
48+
dependency-analysis:
49+
name: "Dependency Analysis"
50+
51+
runs-on: "ubuntu-latest"
52+
53+
strategy:
54+
matrix:
55+
php-version:
56+
- "8.0"
57+
- "8.1"
58+
59+
dependencies:
60+
- "highest"
61+
62+
steps:
63+
- name: "Checkout"
64+
uses: "actions/checkout@v3"
65+
66+
- name: "Setup PHP, with composer and extensions"
67+
uses: "shivammathur/setup-php@v2"
68+
with:
69+
coverage: "none"
70+
extensions: "${{ env.PHP_EXTENSIONS }}"
71+
php-version: "${{ matrix.php-version }}"
72+
tools: "composer-require-checker, composer-unused"
73+
74+
- name: "Install composer dependencies"
75+
uses: "ramsey/composer-install@v2"
76+
with:
77+
dependency-versions: "${{ matrix.dependencies }}"
78+
79+
- name: "Run maglnet/composer-require-checker"
80+
run: "composer-require-checker check"
81+
82+
- name: "Run composer-unused/composer-unused"
83+
run: "composer-unused"
84+
85+
static-code-analysis:
86+
name: "Static Code Analysis"
87+
88+
runs-on: "ubuntu-latest"
89+
90+
strategy:
91+
matrix:
92+
php-version:
93+
- "8.0"
94+
- "8.1"
95+
96+
dependencies:
97+
- "highest"
98+
99+
steps:
100+
- name: "Checkout"
101+
uses: "actions/checkout@v3"
102+
103+
- name: "Setup PHP, with composer and extensions"
104+
uses: "shivammathur/setup-php@v2"
105+
with:
106+
php-version: "${{ matrix.php-version }}"
107+
extensions: "${{ env.PHP_EXTENSIONS }}"
108+
coverage: "none"
109+
110+
- name: "Install composer dependencies"
111+
uses: "ramsey/composer-install@v2"
112+
with:
113+
dependency-versions: "${{ matrix.dependencies }}"
114+
115+
- name: "Static analysis"
116+
run: "composer phpstan"

0 commit comments

Comments
 (0)