-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (69 loc) · 2.17 KB
/
lint.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# This is a basic workflow to help you get started with Actions
name: Lint
on:
workflow_dispatch:
inputs:
lint_command:
required: false
type: string
default: pnpm lint-only
description: The command for running lint
package_manager:
required: false
type: string
default: pnpm
description: The package manager to use
pnpm_version:
required: false
type: string
default: "8"
description: If using pnpm - which version to use
workflow_call:
inputs:
lint_command:
required: false
type: string
default: pnpm lint-only
package_manager:
required: false
type: string
default: pnpm
description: The package manager to use
pnpm_version:
required: false
type: string
default: "8"
description: If using pnpm - which version to use
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
id: checkout
- uses: pnpm/action-setup@v2
if: ${{ inputs.package_manager == 'pnpm' }}
with:
version: ${{ inputs.pnpm_version }}
- uses: actions/setup-node@v3
if: ${{ env.ACT }}
with:
node-version-file: .nvmrc
- uses: actions/setup-node@v3
if: ${{ !env.ACT }}
with:
node-version-file: .nvmrc
cache: ${{ inputs.package_manager }}
- name: Install dependencies (bun)
run: ${{ inputs.package_manager }} install --frozen-lockfile --concurrent-scripts 1
if: ${{ inputs.package_manager == 'bun' }}
working-directory: ${{ inputs.working_directory }}
- name: Install dependencies (npm)
run: npm ci
if: ${{ inputs.package_manager == 'npm' }}
working-directory: ${{ inputs.working_directory }}
- name: Install dependencies (others)
run: ${{ inputs.package_manager }} install --frozen-lockfile
if: ${{ inputs.package_manager != 'npm' && inputs.package_manager != 'bun' }}
working-directory: ${{ inputs.working_directory }}
- name: Lint
run: ${{ inputs.lint_command }}