mirror of
https://github.com/actions/github-script.git
synced 2025-12-08 16:16:21 +00:00
Add install deps action to reuse between workflows
This commit is contained in:
11
.github/actions/install-dependencies/action.yml
vendored
Normal file
11
.github/actions/install-dependencies/action.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
name: 'Install dependencies'
|
||||
description: 'Set up node and install dependencies'
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '20.x'
|
||||
cache: npm
|
||||
|
||||
- run: npm ci
|
||||
8
.github/workflows/check-dist.yml
vendored
8
.github/workflows/check-dist.yml
vendored
@@ -20,13 +20,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '20.x'
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- uses: ./.github/actions/install-dependencies
|
||||
|
||||
- name: Rebuild the dist/ directory
|
||||
run: npm run build
|
||||
|
||||
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -11,10 +11,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '20.x'
|
||||
cache: npm
|
||||
- run: npm ci
|
||||
- uses: ./.github/actions/install-dependencies
|
||||
- run: npm run style:check
|
||||
- run: npm test
|
||||
|
||||
28
.github/workflows/integration.yml
vendored
28
.github/workflows/integration.yml
vendored
@@ -50,12 +50,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
|
||||
restore-keys: ${{runner.os}}-npm-
|
||||
- run: npm ci
|
||||
- uses: ./.github/actions/install-dependencies
|
||||
- id: npm-require
|
||||
uses: ./
|
||||
with:
|
||||
@@ -75,12 +70,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
|
||||
restore-keys: ${{runner.os}}-npm-
|
||||
- run: npm ci
|
||||
- uses: ./.github/actions/install-dependencies
|
||||
- id: previews-default
|
||||
name: Default previews not set
|
||||
uses: ./
|
||||
@@ -133,12 +123,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
|
||||
restore-keys: ${{runner.os}}-npm-
|
||||
- run: npm ci
|
||||
- uses: ./.github/actions/install-dependencies
|
||||
- id: user-agent-default
|
||||
name: Default user-agent not set
|
||||
uses: ./
|
||||
@@ -195,12 +180,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
|
||||
restore-keys: ${{runner.os}}-npm-
|
||||
- run: npm ci
|
||||
- uses: ./.github/actions/install-dependencies
|
||||
- id: debug-default
|
||||
name: Default debug not set
|
||||
uses: ./
|
||||
|
||||
6
.github/workflows/licensed.yml
vendored
6
.github/workflows/licensed.yml
vendored
@@ -20,9 +20,5 @@ jobs:
|
||||
- uses: jonabc/setup-licensed@82c5f4d19e8968efa74a25b132922382c2671fe2
|
||||
with:
|
||||
version: '3.x'
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '20.x'
|
||||
cache: npm
|
||||
- run: npm ci
|
||||
- uses: ./.github/actions/install-dependencies
|
||||
- run: licensed status
|
||||
|
||||
Reference in New Issue
Block a user