Skip to content

Commit 6f0bb43

Browse files
committed
ci: cleanup, add dedicated lint workflow
1 parent 5c78b38 commit 6f0bb43

File tree

5 files changed

+51
-21
lines changed

5 files changed

+51
-21
lines changed
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@ name: Build
33
on:
44
push:
55
branches:
6-
- 'develop'
7-
- 'v2'
6+
- "develop"
7+
- "1.0-develop"
88
pull_request:
9+
branches:
10+
- "develop"
11+
- "1.0-develop"
912

1013
jobs:
1114
ui:
1215
name: UI
1316
runs-on: ubuntu-20.04
14-
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
1517
strategy:
18+
fail-fast: false
1619
matrix:
1720
node-version: [16]
1821
steps:
@@ -23,7 +26,7 @@ jobs:
2326
uses: actions/setup-node@v3
2427
with:
2528
node-version: ${{ matrix.node-version }}
26-
cache: 'yarn'
29+
cache: "yarn"
2730

2831
- name: Install dependencies
2932
run: yarn install --frozen-lockfile
Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@ name: Tests
33
on:
44
push:
55
branches:
6-
- 'develop'
7-
- 'v2'
6+
- "develop"
7+
- "1.0-develop"
88
pull_request:
9+
branches:
10+
- "develop"
11+
- "1.0-develop"
912

1013
jobs:
1114
tests:
1215
name: Tests
1316
runs-on: ubuntu-20.04
14-
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
1517
strategy:
1618
fail-fast: false
1719
matrix:
1820
php: [8.0, 8.1]
19-
database: ['mariadb:10.2', 'mysql:8']
21+
database: ["mariadb:10.2", "mysql:8"]
2022
services:
2123
database:
2224
image: ${{ matrix.database }}
@@ -33,15 +35,15 @@ jobs:
3335
- name: Get cache directory
3436
id: composer-cache
3537
run: |
36-
echo "::set-output name=dir::$(composer config cache-files-dir)"
38+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
3739
3840
- name: Cache
3941
uses: actions/cache@v3
4042
with:
41-
path: |
42-
~/.php_cs.cache
43-
${{ steps.composer-cache.outputs.dir }}
44-
key: ${{ runner.os }}-cache-${{ matrix.php }}-${{ hashFiles('**.composer.lock') }}
43+
path: ${{ steps.composer-cache.outputs.dir }}
44+
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
45+
restore-keys: |
46+
${{ runner.os }}-composer-${{ matrix.php }}-
4547
4648
- name: Setup PHP
4749
uses: shivammathur/setup-php@v2
@@ -57,10 +59,6 @@ jobs:
5759
- name: Install dependencies
5860
run: composer install --no-interaction --no-progress --no-suggest --prefer-dist
5961

60-
- name: PHP CS Fixer
61-
run: vendor/bin/php-cs-fixer fix --dry-run --diff
62-
continue-on-error: true
63-
6462
- name: Unit tests
6563
run: vendor/bin/phpunit --bootstrap vendor/autoload.php tests/Unit
6664
if: ${{ always() }}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: Publish Docker Image
33
on:
44
push:
55
branches:
6-
- 'develop'
7-
- 'release/v*'
6+
- "develop"
7+
- "release/v*"
88

99
jobs:
1010
push:

.github/workflows/lint.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- "develop"
7+
- "1.0-develop"
8+
pull_request:
9+
branches:
10+
- "develop"
11+
- "1.0-develop"
12+
13+
jobs:
14+
lint:
15+
name: Lint
16+
runs-on: ubuntu-20.04
17+
steps:
18+
- name: Code Checkout
19+
uses: actions/checkout@v3
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: '8.1'
25+
tools: composer:v2
26+
coverage: none
27+
28+
- name: PHP CS Fixer
29+
run: vendor/bin/php-cs-fixer fix --dry-run --diff
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
tags:
6-
- 'v*'
6+
- "v*"
77

88
jobs:
99
release:
@@ -17,7 +17,7 @@ jobs:
1717
uses: actions/setup-node@v3
1818
with:
1919
node-version: 16
20-
cache: 'yarn'
20+
cache: "yarn"
2121

2222
- name: Install dependencies
2323
run: yarn install --frozen-lockfile

0 commit comments

Comments
 (0)