Skip to content

Commit

Permalink
ci: cleanup, add dedicated lint workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewpi committed Oct 26, 2022
1 parent 5c78b38 commit 6f0bb43
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 21 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/build.yml → .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@ name: Build
on:
push:
branches:
- 'develop'
- 'v2'
- "develop"
- "1.0-develop"
pull_request:
branches:
- "develop"
- "1.0-develop"

jobs:
ui:
name: UI
runs-on: ubuntu-20.04
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
matrix:
node-version: [16]
steps:
Expand All @@ -23,7 +26,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache: "yarn"

- name: Install dependencies
run: yarn install --frozen-lockfile
Expand Down
24 changes: 11 additions & 13 deletions .github/workflows/tests.yml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@ name: Tests
on:
push:
branches:
- 'develop'
- 'v2'
- "develop"
- "1.0-develop"
pull_request:
branches:
- "develop"
- "1.0-develop"

jobs:
tests:
name: Tests
runs-on: ubuntu-20.04
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
matrix:
php: [8.0, 8.1]
database: ['mariadb:10.2', 'mysql:8']
database: ["mariadb:10.2", "mysql:8"]
services:
database:
image: ${{ matrix.database }}
Expand All @@ -33,15 +35,15 @@ jobs:
- name: Get cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.php_cs.cache
${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-cache-${{ matrix.php }}-${{ hashFiles('**.composer.lock') }}
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php }}-
- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -57,10 +59,6 @@ jobs:
- name: Install dependencies
run: composer install --no-interaction --no-progress --no-suggest --prefer-dist

- name: PHP CS Fixer
run: vendor/bin/php-cs-fixer fix --dry-run --diff
continue-on-error: true

- name: Unit tests
run: vendor/bin/phpunit --bootstrap vendor/autoload.php tests/Unit
if: ${{ always() }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Publish Docker Image
on:
push:
branches:
- 'develop'
- 'release/v*'
- "develop"
- "release/v*"

jobs:
push:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint

on:
push:
branches:
- "develop"
- "1.0-develop"
pull_request:
branches:
- "develop"
- "1.0-develop"

jobs:
lint:
name: Lint
runs-on: ubuntu-20.04
steps:
- name: Code Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: composer:v2
coverage: none

- name: PHP CS Fixer
run: vendor/bin/php-cs-fixer fix --dry-run --diff
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
push:
tags:
- 'v*'
- "v*"

jobs:
release:
Expand All @@ -17,7 +17,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
cache: "yarn"

- name: Install dependencies
run: yarn install --frozen-lockfile
Expand Down

0 comments on commit 6f0bb43

Please sign in to comment.