Add dependency caching for .NET, Node, PHP, and Python workflows
This commit is contained in:
@@ -41,6 +41,14 @@ jobs:
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||
|
||||
- name: Set up dependency caching for faster builds
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.nuget/packages
|
||||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-nuget-
|
||||
|
||||
- name: Build with dotnet
|
||||
run: dotnet build --configuration Release
|
||||
|
||||
@@ -38,6 +38,7 @@ jobs:
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: 'npm'
|
||||
|
||||
- name: npm install, build, and test
|
||||
run: |
|
||||
|
||||
@@ -48,6 +48,21 @@ jobs:
|
||||
with:
|
||||
files: 'composer.json'
|
||||
|
||||
- name: Get Composer Cache Directory
|
||||
id: composer-cache
|
||||
if: steps.check_files.outputs.files_exists == 'true'
|
||||
run: |
|
||||
echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
|
||||
- name: Set up dependency caching for faster installs
|
||||
uses: actions/cache@v2
|
||||
if: steps.check_files.outputs.files_exists == 'true'
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-composer-
|
||||
|
||||
- name: Run composer install if composer.json exists
|
||||
if: steps.check_files.outputs.files_exists == 'true'
|
||||
run: composer validate --no-check-publish && composer install --prefer-dist --no-progress
|
||||
|
||||
@@ -46,6 +46,14 @@ jobs:
|
||||
python -m venv venv
|
||||
source venv/bin/activate
|
||||
|
||||
- name: Set up dependency caching for faster installs
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install -r requirements.txt
|
||||
|
||||
|
||||
Reference in New Issue
Block a user