Add dependency caching for .NET, Node, PHP, and Python workflows
This commit is contained in:
@@ -42,6 +42,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
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
|
- name: Build with dotnet
|
||||||
run: dotnet build --configuration Release
|
run: dotnet build --configuration Release
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ jobs:
|
|||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
- name: npm install, build, and test
|
- name: npm install, build, and test
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -48,6 +48,21 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
files: 'composer.json'
|
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
|
- name: Run composer install if composer.json exists
|
||||||
if: steps.check_files.outputs.files_exists == 'true'
|
if: steps.check_files.outputs.files_exists == 'true'
|
||||||
run: composer validate --no-check-publish && composer install --prefer-dist --no-progress
|
run: composer validate --no-check-publish && composer install --prefer-dist --no-progress
|
||||||
|
|||||||
@@ -46,6 +46,14 @@ jobs:
|
|||||||
python -m venv venv
|
python -m venv venv
|
||||||
source venv/bin/activate
|
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
|
- name: Install dependencies
|
||||||
run: pip install -r requirements.txt
|
run: pip install -r requirements.txt
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user