forked from typescript-eslint/typescript-eslint
-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
62 lines (55 loc) · 2.04 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# IMPORTANT NOTE TO MAINTAINERS
#
# Changes to this composite action should be carefully considered and reviewed because it is referenced
# and executed by multiple workflows in our private-automations repository.
#
# Ensure that a member of @typescript-eslint/core-team tests changes there before merging.
name: 'Prepare: Install'
description: 'Prepares the repo by installing dependencies'
inputs:
node-version:
description: 'The node version to setup'
required: true
registry-url:
description: 'Define registry-url'
required: false
# NOTE: This is required for our use-case of sharing this action across multiple repos
working-directory:
description: 'Override the working directory to run the installation in'
required: false
default: '.'
# outputs: - no outputs
runs:
using: 'composite'
steps:
- name: echo github.ref
shell: bash
working-directory: ${{ inputs.working-directory }}
run: echo ${{ github.ref }}
- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
registry-url: ${{ inputs.registry-url }}
- name: Get yarn cache directory path
shell: bash
id: yarn-cache-dir-path
run: echo "yarn_cache_dir=$(yarn cache dir)" >> $GITHUB_ENV
- uses: actions/cache@v3
id: yarn-cache
with:
path: |
${{ env.yarn_cache_dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
${{ runner.os }}-yarn-
# if the cache was hit - this will run in <1s
- name: Install dependencies
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
yarn --ignore-engines --frozen-lockfile --ignore-scripts
yarn check-clean-workspace-after-install
yarn patch-package