Skip to content

Commit 526da4c

Browse files
authored
Create main.yml
1 parent 8826d79 commit 526da4c

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/main.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
name: Build & Test
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Clone project
19+
uses: actions/checkout@v4
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: 8.3
25+
coverage: none
26+
extensions: pcre
27+
tools: composer:v2
28+
29+
- name: Validate manifest file
30+
run: composer validate --strict
31+
32+
- name: Cache dependencies
33+
uses: actions/cache@v4
34+
with:
35+
path: vendor
36+
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
37+
restore-keys: ${{ runner.os }}-composer-
38+
39+
- name: Install dependencies
40+
run: composer install --no-interaction --no-progress
41+
42+
- name: Lint project files
43+
run: |
44+
set -e # Stop on error.
45+
find . -path ./vendor -prune -o -name "*.php" -print0 | xargs -0 -n 1 php -l
46+
47+
- name: Lint codes
48+
run: composer lint
49+
50+
- name: Check coding convention
51+
run: composer check
52+
53+
- name: Security check
54+
run: composer audit
55+
56+
- name: Run tests
57+
run: composer test

0 commit comments

Comments
 (0)