-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
47 lines (44 loc) · 1.34 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
name: "Yarn, Typescript & NPM"
description: "Build, Lint and Test a typescript package"
inputs:
registry-url:
description: "Registry to use NPM or github"
required: false
default: "https://registry.npmjs.org"
package-manager:
description: "Package manager to use yarn or npm"
required: false
default: "npm"
node-version:
description: 'Which version of NodeJS to use'
required: false
default: "20.x"
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
registry-url: ${{ inputs.registry-url }}
cache: ${{ inputs.package-manager }}
- name: "Install"
shell: "bash"
run: |
if [ "${{ inputs.package-manager }}" == "yarn" ]; then
yarn install --frozen-lockfile --check-files
elif [ "${{ inputs.package-manager }}" == "npm" ]; then
npm install --ci
else
echo "Unknown package-manager ${{ inputs.package-manager }}"
exit 1
fi
- run: npm run build --if-present
shell: "bash"
- run: npm run lint --if-present -- --fix=false # ensure eslint is not configured to --fix
shell: "bash"
- run: npm run test --if-present
shell: "bash"