-
-
Notifications
You must be signed in to change notification settings - Fork 2k
62 lines (60 loc) · 1.56 KB
/
ci.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
name: CI
on:
workflow_dispatch:
workflow_call:
inputs:
ref:
description: 'Branch or tag ref to check out'
type: string
required: false
default: ''
artifact_name:
description: 'Name of the artifact to upload'
type: string
required: false
default: 'npm-package'
pull_request:
branches:
- '**'
push:
branches:
- main
- restructure
jobs:
build_test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || '' }}
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: npm ci
- name: test
env:
CI: true
COVERAGE: true
FLAKEY: false
# Not using `npm test` since it rebuilds source which npm ci has already done
run: |
npm run lint
npm run test:unit
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2.1.2
timeout-minutes: 2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Package
# Use --ignore-scripts here to avoid re-building again before pack
run: |
npm pack --ignore-scripts
mv preact-*.tgz preact.tgz
- name: Upload npm package
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifact_name || 'npm-package' }}
path: preact.tgz