Skip to content

Commit

Permalink
workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
MWest2020 committed Aug 5, 2024
1 parent d1d895b commit 3ecf67b
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/markdown-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Remark Lint on Pull Request

on:
pull_request:
paths:
- '**/*.md'
push:
paths:
- '**/*.md'

jobs:
remark-lint:
name: runner / remark-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install remark presets
run: npm install remark-cli remark-preset-lint-consistent remark-preset-lint-recommended remark-lint-list-item-indent
shell: bash
- name: Run remark
run: npx remark . --output --use remark-preset-lint-consistent --use remark-preset-lint-recommended --use remark-lint-list-item-indent
- name: Check for linting errors
run: |
npx remark . --use remark-preset-lint-consistent --use remark-preset-lint-recommended --use remark-lint-list-item-indent
continue-on-error: false
- name: Git commit
if: success()
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add .
git reset package.json
git reset package-lock.json
git reset node_modules
git commit -m "Update src from remark-lint" || echo "No changes to commit"
git pull origin $(git rev-parse --abbrev-ref HEAD) --rebase --autostash
git push
27 changes: 27 additions & 0 deletions .github/workflows/phpcbf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: php-cbf

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: cs2pr, phpcbf

- name: Run phpcbf
run: phpcbf .
continue-on-error: true
- name: Git commit
run: |
git config user.name "GitHub Actions"
git config user.email ""
git add src
git commit -m "Update src from PHP Codesniffer" || echo "No changes to commit"
git pull origin $(git rev-parse --abbrev-ref HEAD) --rebase --autostash
git push
19 changes: 19 additions & 0 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: php-cs

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: cs2pr, phpcs

- name: Run phpcs
run: phpcs -q --report=checkstyle src | cs2pr
continue-on-error: true
17 changes: 17 additions & 0 deletions .github/workflows/phpmd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: php-md

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: cs2pr, phpmd
- name: Run phpmd
run: phpmd src github phpmd.xml --not-strict
23 changes: 23 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: php-unit

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: php-actions/composer@v6
with:
php_version: "7.4"
php_extensions: redis exif mongodb intl pdo_pgsql zip mysqli pdo_mysql pcntl gd gmp
version: 2.x
command: require symfony/test-pack
- name: Install dependencies
run: composer install
- name: Run tests with coverage
env:
XDEBUG_MODE: coverage
run: |
phpunit --bootstrap ./tests/bootstrap.php --configuration phpunit.xml --coverage-html ./coverage --coverage-text | tee coverage.txt

0 comments on commit 3ecf67b

Please sign in to comment.