-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: William Desportes <williamdes@wdes.fr>
- Loading branch information
1 parent
b13400b
commit 34fbd63
Showing
3 changed files
with
114 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,49 @@ | ||
name: Lint and analyse php files | ||
|
||
on: | ||
push: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
branches: | ||
- master | ||
|
||
jobs: | ||
lint-php: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use php 7.1 | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.1 | ||
tools: composer:v2 | ||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
- name: Cache module | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.composer/cache/ | ||
key: composer-cache | ||
- name: Install dependencies | ||
run: composer install | ||
- name: Lint files | ||
run: composer run phpcs | ||
|
||
analyse-php: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use php 7.1 | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.1 | ||
tools: composer:v2 | ||
- name: Cache module | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.composer/cache/ | ||
key: composer-cache | ||
- name: Install dependencies | ||
run: composer install | ||
- name: Analyse files | ||
run: composer run phpstan |
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,20 @@ | ||
name: Lint php documentation | ||
|
||
on: | ||
push: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
branches: | ||
- master | ||
|
||
jobs: | ||
lint-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: lint php documentation | ||
uses: sudo-bot/action-doctum@v5 | ||
with: | ||
config-file: ci/doctum-config.php | ||
method: "parse" | ||
cli-args: "--output-format=github --no-ansi --no-progress -v --ignore-parse-errors" |
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,45 @@ | ||
name: Run tests | ||
|
||
on: | ||
push: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test-php: | ||
name: Test on php ${{ matrix.php-version }} and ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
php-version: ["7.1", "7.2", "7.3", "7.4", "8.0"] | ||
os: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use php ${{ matrix.php-version }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: mbstring | ||
coverage: xdebug | ||
- name: Cache module | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.composer/cache/ | ||
key: composer-cache | ||
- name: Install dependencies | ||
run: composer install | ||
- name: Run php tests | ||
run: composer run phpunit | ||
- name: Send coverage | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
flags: unit-${{ matrix.php-version }}-${{ matrix.os }} | ||
name: phpunit-${{ matrix.php-version }}-${{ matrix.os }} | ||
- name: Send coverage to Scrutinizer | ||
uses: sudo-bot/action-scrutinizer@latest | ||
# Upload can fail on forks | ||
continue-on-error: true | ||
with: | ||
cli-args: "--format=php-clover build/logs/clover.xml" |