-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
244695f
commit 8fcc6e5
Showing
5 changed files
with
147 additions
and
8 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
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,46 @@ | ||
name: 'Set up PHP' | ||
description: 'Set up PHP and install composer dependencies from scratch or from cache' | ||
|
||
inputs: | ||
php-version: | ||
description: 'The php version to use.' | ||
default: '7.2' | ||
required: false | ||
|
||
tools: | ||
description: 'Tools to pass to shivammathur/setup-php.' | ||
default: 'composer:v2' | ||
required: false | ||
|
||
flags: | ||
description: 'Flags to use when installing composer dependencies.' | ||
default: '--no-interaction --no-progress' | ||
required: false | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: 'Set up PHP' | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ inputs.php-version }} | ||
tools: ${{ inputs.tools }} | ||
|
||
- name: 'Get Composer cache directory' | ||
shell: bash | ||
id: composer-cache | ||
run: | | ||
echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- name: 'Handle Composer cache' | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: 'Install composer dependencies' | ||
shell: bash | ||
run: | | ||
composer install ${{ inputs.flags }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: 'Setup Node' | ||
description: 'Setup Node' | ||
|
||
inputs: | ||
node-version: | ||
description: 'The Node.js version to use' | ||
default: '14' | ||
required: false | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: 'Setup Node' | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ inputs.node-version }} |
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,25 @@ | ||
name: Install yarn dependencies | ||
description: Install yarn dependencies from scratch or from cache | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: myparcelnl/actions/setup-node@v1 | ||
|
||
- name: 'Get yarn cache directory path' | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
shell: bash | ||
|
||
- name: 'Prepare yarn cache' | ||
uses: actions/cache@v2 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: 'Install yarn dependencies' | ||
run: yarn install --frozen-lockfile | ||
shell: bash |