-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (48 loc) · 1.05 KB
/
build-test-common.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
name: Build & Test Common
on:
workflow_call:
inputs:
actor:
required: true
type: string
ref:
required: true
type: string
commit:
required: true
type: string
is_main_branch:
required: true
type: boolean
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- uses: actions/cache@v4
with:
path: |
node_modules
dist
key: ${{ inputs.commit }}-test
- name: install
run: |
npm ci
- name: compile
run: |
npm run compile
- name: test
run: npm test
- name: dry run publish
if: ${{ inputs.is_main_branch == false }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.MY_PA_TOKEN }}
run: |
npm run release