diff --git a/.github/workflows/markdown-check.yml b/.github/workflows/markdown-check.yml new file mode 100644 index 00000000..09b30ddf --- /dev/null +++ b/.github/workflows/markdown-check.yml @@ -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 "actions@github.com" + 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 diff --git a/.github/workflows/phpcbf.yml b/.github/workflows/phpcbf.yml new file mode 100644 index 00000000..059e0d53 --- /dev/null +++ b/.github/workflows/phpcbf.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml new file mode 100644 index 00000000..1c70a0c4 --- /dev/null +++ b/.github/workflows/phpcs.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/phpmd.yml b/.github/workflows/phpmd.yml new file mode 100644 index 00000000..05846717 --- /dev/null +++ b/.github/workflows/phpmd.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml new file mode 100644 index 00000000..8aea8cea --- /dev/null +++ b/.github/workflows/phpunit.yml @@ -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