Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use actions/setup-node@v2 to cache node_modules #216

Merged
merged 1 commit into from Aug 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 11 additions & 6 deletions .github/workflows/build-release.yml
Expand Up @@ -11,14 +11,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
uses: actions/checkout@v2

- name: Build JS dependencies
uses: PrestaShopCorp/github-action-build-js/12@v1.0
- uses: actions/setup-node@v2
with:
cmd: npm
path: ./_dev

node-version: '14'
cache: npm
cache-dependency-path: '_dev/package-lock.json'

- name: Install & build
working-directory: _dev
run: |
npm install
npm run build

- name: Install dev composer dependencies
run: composer install
Expand Down
24 changes: 18 additions & 6 deletions .github/workflows/js.yml
Expand Up @@ -6,13 +6,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: '14'
cache: npm
cache-dependency-path: '_dev/package-lock.json'

- name: Lint JS files
uses: PrestaShopCorp/github-action-lint-js/12@v1.0
with:
cmd: npm
path: ./_dev
working-directory: _dev
run: |
npm install
npm run lint

unit-tests:
name: JS Unit tests
Expand All @@ -21,8 +27,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: '14'
cache: npm
cache-dependency-path: '_dev/package-lock.json'

- name: Install & run
working-directory: _dev
run: |
cd _dev
npm install
npm run test:unit
6 changes: 3 additions & 3 deletions .github/workflows/php.yml
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
uses: actions/checkout@v2

- name: PHP syntax checker 7.3
uses: prestashop/github-action-php-lint/7.3@master
Expand All @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
uses: actions/checkout@v2

- name: Run PHP-CS-Fixer
uses: prestashopcorp/github-action-php-cs-fixer@master
Expand All @@ -32,7 +32,7 @@ jobs:
presta-versions: ['1.7.7.0', 'latest']
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
uses: actions/checkout@v2

- name: Cache vendor folder
uses: actions/cache@v1
Expand Down
24 changes: 15 additions & 9 deletions .github/workflows/publish.yml
Expand Up @@ -10,13 +10,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
uses: actions/checkout@v2

- name: Build JS dependencies
uses: PrestaShopCorp/github-action-build-js/12@v1.0
- uses: actions/setup-node@v2
with:
cmd: npm
path: ./_dev
node-version: '14'
cache: npm
cache-dependency-path: '_dev/package-lock.json'

- name: Install & build
working-directory: _dev
run: |
npm install
npm run build

- name: Install composer dependencies
run: composer install --no-dev -o
Expand All @@ -25,7 +31,7 @@ jobs:
uses: PrestaShopCorp/github-action-clean-before-deploy@v1.0

- name: Create & upload artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
with:
name: ${{ github.event.repository.name }}
path: ../
Expand All @@ -36,7 +42,7 @@ jobs:
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v1
uses: actions/download-artifact@v2
with:
name: ${{ github.event.repository.name }}

Expand All @@ -61,7 +67,7 @@ jobs:
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v1
uses: actions/download-artifact@v2
with:
name: ${{ github.event.repository.name }}

Expand Down Expand Up @@ -101,7 +107,7 @@ jobs:
if: github.event.release.prerelease == false
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
uses: actions/checkout@v2

- name: Download release asset
uses: dsaltares/fetch-gh-release-asset@0.0.5
Expand Down