Skip to content

Commit 0f04f40

Browse files
committed
chore: check commit messages and run tests in CI
1 parent 774b6bf commit 0f04f40

File tree

2 files changed

+62
-40
lines changed

2 files changed

+62
-40
lines changed

.github/workflows/lint.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/validation.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Validation
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
check-commit-message:
10+
name: Check Commit Message
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Check commit message type
15+
uses: gsactions/commit-message-checker@v2
16+
with:
17+
# Conventional commits only:
18+
pattern: '^(feat|fix|docs|style|refactor|test|chore|perf|ci|revert|release)(\([A-Za-z-]+\))?!?: .+'
19+
# To allow Merge commits:
20+
# pattern: '^(((feat|fix|docs|style|refactor|test|chore|perf|ci|revert|release)(\([A-Za-z-]+\))?!?:)|[Mm]erge.+branch) .+'
21+
error: 'Commit messages must begin with a valid commit type.'
22+
excludeDescription: 'true'
23+
excludeTitle: 'true'
24+
checkAllCommitMessages: 'true'
25+
accessToken: ${{ secrets.GITHUB_TOKEN }}
26+
27+
lint:
28+
name: Lint & Test
29+
runs-on: ubuntu-latest
30+
31+
strategy:
32+
matrix:
33+
node-version: [18.x]
34+
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v3
38+
39+
- name: Use Node.js ${{ matrix.node-version }}
40+
uses: actions/setup-node@v3
41+
with:
42+
node-version: ${{ matrix.node-version }}
43+
44+
- name: Install PHP dependencies with Composer
45+
uses: php-actions/composer@v6
46+
with:
47+
php_version: '8.1'
48+
version: 2.x
49+
50+
- name: Install npm dependencies
51+
run: npm ci
52+
53+
- name: Install custom plugin npm dependencies
54+
run: npm run plugins:install
55+
56+
- name: Lint
57+
run: npm run lint
58+
env:
59+
CI: true
60+
61+
- name: Test
62+
run: npm run test:ci

0 commit comments

Comments
 (0)