Skip to content

Commit

Permalink
update actions cache dir
Browse files Browse the repository at this point in the history
  • Loading branch information
lyswhut committed Aug 23, 2024
1 parent cf94212 commit 0e8e287
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 16 deletions.
3 changes: 1 addition & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ runs:
id: cache-npm
uses: actions/cache@v4
with:
path: |
${{ env.NPM_CACHE }}
path: ${{ env.NPM_CACHE }}
key: ${{ runner.os }}-npm-cache-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-cache-
Expand Down
24 changes: 18 additions & 6 deletions .github/workflows/beta-pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,18 @@ jobs:
Windows:
name: Windows
runs-on: windows-latest
env:
NPM_CACHE: '%LocalAppData%/npm-cache'
# needs: CheckCode
steps:
- name: Check out git repository
uses: actions/checkout@v4

- name: Get npm cache directory
shell: pwsh
run: echo "NPM_CACHE=$(npm config get cache)" >> $env:GITHUB_ENV

- name: Setup Node Env
env:
NPM_CACHE: ${{ env.NPM_CACHE }}
uses: ./.github/actions/setup

- name: Build src code
Expand Down Expand Up @@ -130,8 +134,6 @@ jobs:
name: Mac
runs-on: macos-latest
# needs: CheckCode
env:
NPM_CACHE: ~/.npm
steps:
- name: Check out git repository
uses: actions/checkout@v4
Expand All @@ -143,7 +145,13 @@ jobs:
source ~/.venv/bin/activate
python3 -m pip install setuptools
- name: Get npm cache directory
shell: bash
run: echo "NPM_CACHE=$(npm config get cache)" >> $GITHUB_ENV

- name: Setup Node Env
env:
NPM_CACHE: ${{ env.NPM_CACHE }}
uses: ./.github/actions/setup

- name: Build src code
Expand Down Expand Up @@ -177,8 +185,6 @@ jobs:
Linux:
name: Linux
runs-on: ubuntu-latest
env:
NPM_CACHE: ~/.npm
# needs: CheckCode
steps:
- name: Install package
Expand All @@ -187,7 +193,13 @@ jobs:
- name: Check out git repository
uses: actions/checkout@v4

- name: Get npm cache directory
shell: bash
run: echo "NPM_CACHE=$(npm config get cache)" >> $GITHUB_ENV

- name: Setup Node Env
env:
NPM_CACHE: ${{ env.NPM_CACHE }}
uses: ./.github/actions/setup

- name: Build src code
Expand Down
39 changes: 31 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,21 @@ jobs:
Windows:
name: Windows
runs-on: windows-latest
env:
NPM_CACHE: '%LocalAppData%/npm-cache'
# needs: CheckCode
steps:
- name: Check out git repository
uses: actions/checkout@v4

- name: Get npm cache directory
shell: pwsh
run: echo "NPM_CACHE=$(npm config get cache)" >> $env:GITHUB_ENV

- name: Show Env
run: echo "${{ env.NPM_CACHE }}"

- name: Setup Node Env
env:
NPM_CACHE: ${{ env.NPM_CACHE }}
uses: ./.github/actions/setup

- name: Build src code
Expand All @@ -77,14 +84,18 @@ jobs:
Windows_7:
name: Windows_7
runs-on: windows-latest
env:
NPM_CACHE: '%LocalAppData%/npm-cache'
# needs: CheckCode
steps:
- name: Check out git repository
uses: actions/checkout@v4

- name: Get npm cache directory
shell: pwsh
run: echo "NPM_CACHE=$(npm config get cache)" >> $env:GITHUB_ENV

- name: Setup Node Env
env:
NPM_CACHE: ${{ env.NPM_CACHE }}
uses: ./.github/actions/setup

- name: Build src code
Expand Down Expand Up @@ -114,8 +125,6 @@ jobs:
Mac:
name: Mac
runs-on: macos-latest
env:
NPM_CACHE: ~/.npm
# needs: CheckCode
steps:
- name: Check out git repository
Expand All @@ -128,7 +137,15 @@ jobs:
source ~/.venv/bin/activate
python3 -m pip install setuptools
- name: Get npm cache directory
shell: bash
run: echo "NPM_CACHE=$(npm config get cache)" >> $GITHUB_ENV

- name: Show Env
run: echo "${{ env.NPM_CACHE }}"
- name: Setup Node Env
env:
NPM_CACHE: ${{ env.NPM_CACHE }}
uses: ./.github/actions/setup

- name: Build src code
Expand All @@ -152,8 +169,6 @@ jobs:
Linux:
name: Linux
runs-on: ubuntu-latest
env:
NPM_CACHE: ~/.npm
# needs: CheckCode
steps:
- name: Install package
Expand All @@ -162,7 +177,15 @@ jobs:
- name: Check out git repository
uses: actions/checkout@v4

- name: Get npm cache directory
shell: bash
run: echo "NPM_CACHE=$(npm config get cache)" >> $GITHUB_ENV

- name: Show Env
run: echo "${{ env.NPM_CACHE }}"
- name: Setup Node Env
env:
NPM_CACHE: ${{ env.NPM_CACHE }}
uses: ./.github/actions/setup

- name: Build src code
Expand Down

0 comments on commit 0e8e287

Please sign in to comment.