Skip to content

Commit

Permalink
Add a linting CI for formatting and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
allejo committed Jan 23, 2022
1 parent f90d735 commit 6b20340
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Linting

on:
push: ~
pull_request: ~

jobs:
docs:
name: Documentation Kept Updated
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up PHP 8.0
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: mbstring

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install

- name: Generate the documentation
run: composer doc

- name: Check Generated Docs
run: git diff --exit-code

formatting:
name: Code Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up PHP 8.0
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: mbstring

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install

- name: Check formatting
run: composer cs-check

0 comments on commit 6b20340

Please sign in to comment.