Skip to content

Commit

Permalink
feat(ci): Add GitHub Action workflows
Browse files Browse the repository at this point in the history
chore(deps): Remove the `dist` folder
chore(plugin): Remove check for `/dist/autoload.php` when requiring Composer dependencies
chore(lint): Ignore the `public` folder when linting
  • Loading branch information
Log1x committed Nov 29, 2022
1 parent 2e6ad49 commit 8a36608
Show file tree
Hide file tree
Showing 1,455 changed files with 147 additions and 152,556 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Compatibility Checks

on:
push:
branches: [master]

jobs:
compatibility:
runs-on: ${{ matrix.operating-system }}
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4', '8.0']
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: xdebug
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php-versions }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-${{ matrix.php-versions }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader --no-suggest
- name: PHP lint
run: composer run-script lint
29 changes: 29 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Main

on: [pull_request]

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
coverage: xdebug
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-7.3.x-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-7.3.x-composer-
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader --no-suggest
- name: PHP lint
run: composer run-script lint
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish release

on:
push:
tags:
- '*'

jobs:
release:
name: Publish release
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: xdebug
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader --no-suggest --no-dev
- name: Cleanup unnecessary files
run: rm -rf .git .github .editorconfig .prettierrc .gitattributes .gitignore assets composer.json composer.lock package.json yarn.lock webpack.mix.js tailwind.config.js
- name: Get the version
id: get_version
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
shell: bash
- name: Create subfolder
run: mkdir gutentweaks && mv ./* gutentweaks/ 2>/dev/null
continue-on-error: true
- name: Create distributable zip file
uses: montudor/[email protected]
with:
args: zip -qq -r9 gutentweaks.zip gutentweaks
- name: Upload zip as release asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: gutentweaks.zip
asset_name: gutentweaks-${{ steps.get_version.outputs.version }}.zip
tag: ${{ github.ref }}
overwrite: true
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"scripts": {
"lint": [
"phpcs --ignore=vendor --extensions=php --standard=PSR12 ."
"phpcs --ignore=public,vendor --extensions=php --standard=PSR12 ."
]
},
"config": {
Expand Down
45 changes: 32 additions & 13 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions dist/autoload.php

This file was deleted.

1 change: 0 additions & 1 deletion dist/bin/minifycss

This file was deleted.

1 change: 0 additions & 1 deletion dist/bin/minifyjs

This file was deleted.

1 change: 0 additions & 1 deletion dist/bin/phpcbf

This file was deleted.

1 change: 0 additions & 1 deletion dist/bin/phpcs

This file was deleted.

Loading

0 comments on commit 8a36608

Please sign in to comment.