Skip to content

Commit

Permalink
added a first custom action
Browse files Browse the repository at this point in the history
  • Loading branch information
lucassantosandre committed Apr 23, 2024
1 parent 196e135 commit b3fd760
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
15 changes: 15 additions & 0 deletions .github/actions/cached-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Get & Cache Dependencies'
description: 'Get and cache dependencies for faster workflow runs'
runs:
using: 'composite'
steps:
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: node_modules
key: deps-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
shell: bash
11 changes: 2 additions & 9 deletions .github/workflows/lint-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@ jobs:
steps:
- name: Get code
uses: actions/checkout@v3
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: node_modules
key: deps-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Load & Cache Dependencies
uses: ./.github/actions/cached-deps
- name: Lint code
run: npm run lint

0 comments on commit b3fd760

Please sign in to comment.