Skip to content

Commit

Permalink
Force GitHub Actions npm cache reset
Browse files Browse the repository at this point in the history
  • Loading branch information
XDex committed Dec 3, 2021
1 parent c3bfe14 commit 7b4807c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deployRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
id: npm-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}-${{ secrets.NPM_CACHE_VERSION }} # increment NPM_CACHE_VERSION secret to force cache reset
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
id: npm-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}-${{ secrets.NPM_CACHE_VERSION }} # increment NPM_CACHE_VERSION secret to force cache reset
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
id: npm-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}-${{ secrets.NPM_CACHE_VERSION }} # increment NPM_CACHE_VERSION secret to force cache reset
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- name: Build
run: npm run test:functional:build:int
- name: Run Unit Test
run: npx karma start karma.saucelabs.conf.js --single-run

functional-test:
name: "Functional Test"
runs-on: ubuntu-latest
Expand All @@ -38,12 +38,11 @@ jobs:
id: npm-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}-${{ secrets.NPM_CACHE_VERSION }} # increment NPM_CACHE_VERSION secret to force cache reset
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- name: Build
run: npm run test:functional:build:int
- name: Run Functional Test
run: npx testcafe -q -c 5 'saucelabs:Chrome@latest:macOS 11.00','saucelabs:IE@latest:Windows 10','saucelabs:Firefox@latest:Windows 10','saucelabs:Safari@latest:macOS 11.00'

4 changes: 2 additions & 2 deletions .github/workflows/pre-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_JOB: "Alloy Pre-Deploy Workflow"
SAUCE_CAPABILITIES_OVERRIDES_PATH: 'sauceLabsCapabilities.json'
ALLOY_ENV: int
ALLOY_ENV: int

jobs:
e2e-test:
Expand All @@ -19,7 +19,7 @@ jobs:
id: npm-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}-${{ secrets.NPM_CACHE_VERSION }} # increment NPM_CACHE_VERSION secret to force cache reset
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre-edge-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
id: npm-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}-${{ secrets.NPM_CACHE_VERSION }} # increment NPM_CACHE_VERSION secret to force cache reset
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
Expand All @@ -42,4 +42,4 @@ jobs:
- name: Run TestCafe Tests
run: npx testcafe -q -c 5 'saucelabs:Chrome@latest:macOS 11.00','saucelabs:IE@latest:Windows 10','saucelabs:Firefox@latest:Windows 10','saucelabs:Safari@latest:macOS 11.00'
env:
ALLOY_PROD_VERSION: ${{ steps.package-version.outputs.current-version }}
ALLOY_PROD_VERSION: ${{ steps.package-version.outputs.current-version }}
6 changes: 3 additions & 3 deletions .github/workflows/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
id: npm-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}-${{ secrets.NPM_CACHE_VERSION }} # increment NPM_CACHE_VERSION secret to force cache reset
- name: Get version from package
id: package-version
uses: martinbeentjes/npm-get-version-action@master
Expand All @@ -62,9 +62,9 @@ jobs:
- name: Run TestCafe Tests
run: npx testcafe -q -c 5 'saucelabs:Chrome@latest:macOS 11.00','saucelabs:IE@latest:Windows 10','saucelabs:Firefox@latest:Windows 10','saucelabs:Safari@latest:macOS 11.00'
env:
ALLOY_PROD_VERSION: ${{ steps.package-version.outputs.current-version }}
ALLOY_PROD_VERSION: ${{ steps.package-version.outputs.current-version }}
- uses: craftech-io/slack-action@v1
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
status: failure
if: failure()
if: failure()
4 changes: 2 additions & 2 deletions .github/workflows/publish-to-npm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
id: npm-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}-${{ secrets.NPM_CACHE_VERSION }} # increment NPM_CACHE_VERSION secret to force cache reset
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- name: "Publish to NPM"
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.ADOBE_BOT_NPM_TOKEN }}
access: 'public'
access: 'public'

0 comments on commit 7b4807c

Please sign in to comment.