-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update GitHub Workflow & Cleanup bin shells (#108)
* Add reporting to PHPCS. * Updates to local bin shell files. * Wrap exposed features into funtions. * Update to latest install shell. * Update Workflow dependencies to latest version to avoid deprecations in Actions. - Add Changed Files action to get from step. * Add new composite Action. * Update default workflow to use new composite action to be more dynamic. * Update formatting of array for bash. * Remove env. * Update composite to accept a token from the input value. * Misspelled matrix. * Add at least one extension.
- Loading branch information
Showing
8 changed files
with
323 additions
and
203 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,70 @@ | ||
name: CI Setup | ||
description: "Sets up the environment for jobs during CI workflow" | ||
# https://alejandrocelaya.blog/2022/08/19/how-to-reduce-duplication-in-your-github-actions-workflows/ | ||
|
||
inputs: | ||
extensions: | ||
default: 'curl, mysql, zip' | ||
description: 'shivammathur/setup-php extensions' | ||
required: false | ||
extensions-cache-key: | ||
description: 'The key used to cache PHP extensions' | ||
required: true | ||
php-version: | ||
description: 'The PHP version to be setup' | ||
required: true | ||
token: | ||
description: 'A GitHub PAT' | ||
required: true | ||
tools: | ||
default: 'composer' | ||
description: 'shivammathur/setup-php tools' | ||
required: false | ||
outputs: | ||
files: | ||
description: 'All changed files' | ||
value: ${{ steps.files.outputs.all }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup cache extensions | ||
id: extcache | ||
uses: shivammathur/cache-extensions@v1 | ||
with: | ||
php-version: ${{ inputs.php-version }} | ||
extensions: ${{ inputs.extensions }} | ||
key: ${{ inputs.extensions-cache-key }} | ||
|
||
- name: Cache extensions | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.extcache.outputs.dir }} | ||
key: ${{ steps.extcache.outputs.key }} | ||
restore-keys: ${{ steps.extcache.outputs.key }} | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ inputs.php-version }} | ||
coverage: xdebug | ||
extensions: ${{ inputs.extensions }} | ||
tools: ${{ inputs.tools }} | ||
|
||
- name: Composer config | ||
run: | | ||
composer config github-oauth.github.com "${{ env.GITHUB_TOKEN }}" | ||
env: | ||
GITHUB_TOKEN: ${{ inputs.token }} | ||
shell: bash | ||
|
||
- name: Composer update | ||
run: composer update --no-interaction --optimize-autoloader | ||
shell: bash | ||
|
||
- name: Get Changed Files | ||
id: files | ||
uses: masesgroup/retrieve-changed-files@v2 |
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
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
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
Oops, something went wrong.