Skip to content

Commit

Permalink
Remove duplicated caching logic from workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
levinmr committed Feb 21, 2024
1 parent ef64da4 commit f102faf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 45 deletions.
34 changes: 4 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,8 @@ jobs:
with:
node-version: "lts/*"
cache: 'npm'
- name: Create Checksum of package.json
run: echo PACKAGE_CHECKSUM="$(shasum package.json | awk '{ print $1 }')" >> "$GITHUB_ENV"
- name: Restore Cache
uses: actions/cache/restore@v4
with:
path: ./node_modules
key: v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
- name: Install Dependencies
run: npm install
- name: Save Cache
uses: actions/cache/save@v4
id: cache
with:
path: ./node_modules
key: v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
- name: install dependencies
run: npm ci
- name: lint javascript
run: npm run lint
test:
Expand Down Expand Up @@ -56,21 +43,8 @@ jobs:
with:
node-version: "lts/*"
cache: 'npm'
- name: Create Checksum of package.json
run: echo PACKAGE_CHECKSUM="$(shasum package.json | awk '{ print $1 }')" >> "$GITHUB_ENV"
- name: Restore Cache
uses: actions/cache/restore@v4
with:
path: ./node_modules
key: v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
- name: Install Dependencies
run: npm install
- name: Save Cache
uses: actions/cache/save@v4
id: cache
with:
path: ./node_modules
key: v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
- name: install dependencies
run: npm ci
- name: run tests
run: npm test
deploy_dev:
Expand Down
17 changes: 2 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,8 @@ jobs:
with:
node-version: "lts/*"
cache: 'npm'
- name: Create Checksum of package.json
run: echo PACKAGE_CHECKSUM="$(shasum package.json | awk '{ print $1 }')" >> "$GITHUB_ENV"
- name: Restore Cache
uses: actions/cache/restore@v4
with:
path: ./node_modules
key: v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
- name: Install Dependencies
run: npm install
- name: Save Cache
uses: actions/cache/save@v4
id: cache
with:
path: ./node_modules
key: v1-dependencies-${{ env.PACKAGE_CHECKSUM }}
- name: install dependencies
run: npm ci
- name: Replace env vars in manifest.yml file
run: |
sudo apt-get update
Expand Down

0 comments on commit f102faf

Please sign in to comment.