-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a linting CI for formatting and documentation
- Loading branch information
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |