mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2025-12-08 00:03:09 +00:00
ci(action): switch GitHub Actions to use pnpm and update actions
This commit is contained in:
parent
597ac1498f
commit
55858d89d9
77
.github/workflows/node.js.yml
vendored
77
.github/workflows/node.js.yml
vendored
@ -2,9 +2,9 @@ name: Node.js CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [main]
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [main]
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
@ -14,46 +14,47 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [14.x, 16.x, 18.x ]
|
node-version: [16.x, 18.x, 22.x]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v5
|
uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
- uses: actions/cache@v4
|
# Use built-in package manager cache for pnpm
|
||||||
with:
|
cache: 'pnpm'
|
||||||
path: ~/.npm
|
cache-dependency-path: '**/pnpm-lock.yaml'
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
- name: Setup pnpm
|
||||||
restore-keys: |
|
uses: pnpm/action-setup@v2
|
||||||
${{ runner.os }}-node-
|
with:
|
||||||
- run: npm ci
|
version: 8
|
||||||
name: Install dependencies
|
- name: Install dependencies (pnpm)
|
||||||
- name: Test
|
run: pnpm install --frozen-lockfile
|
||||||
env:
|
- name: Test
|
||||||
NCM_API_TEST_LOGIN_COUNTRY_CODE: ${{ secrets.NCM_API_TEST_LOGIN_COUNTRY_CODE }}
|
env:
|
||||||
NCM_API_TEST_LOGIN_PHONE: ${{ secrets.NCM_API_TEST_LOGIN_PHONE }}
|
NCM_API_TEST_LOGIN_COUNTRY_CODE: ${{ secrets.NCM_API_TEST_LOGIN_COUNTRY_CODE }}
|
||||||
NCM_API_TEST_LOGIN_PASSWORD: ${{ secrets.NCM_API_TEST_LOGIN_PASSWORD }}
|
NCM_API_TEST_LOGIN_PHONE: ${{ secrets.NCM_API_TEST_LOGIN_PHONE }}
|
||||||
run: npm test
|
NCM_API_TEST_LOGIN_PASSWORD: ${{ secrets.NCM_API_TEST_LOGIN_PASSWORD }}
|
||||||
|
run: pnpm test
|
||||||
lint:
|
lint:
|
||||||
name: Lint
|
name: Lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [14.x]
|
node-version: [18.x]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v5
|
uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
- uses: actions/cache@v4
|
cache: 'pnpm'
|
||||||
with:
|
cache-dependency-path: '**/pnpm-lock.yaml'
|
||||||
path: ~/.npm
|
- name: Setup pnpm
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
uses: pnpm/action-setup@v2
|
||||||
restore-keys: |
|
with:
|
||||||
${{ runner.os }}-node-
|
version: 8
|
||||||
- run: npm ci
|
- name: Install dependencies (pnpm)
|
||||||
name: Install dependencies
|
run: pnpm install --frozen-lockfile
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: npm run lint
|
run: pnpm run lint
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user