This repository has been archived by the owner. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
63 lines (63 loc) · 1.66 KB
/
nodejs.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
name: Node CI
on:
push:
branches:
- trunk
pull_request:
jobs:
test:
strategy:
matrix:
node-version: [12, 14, 16]
runs-on: ubuntu-latest
steps:
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: Checkout
uses: actions/[email protected]
- name: Deduplicate packages
if: ${{ matrix.node-version == '14' }}
run: yarn dedupe --check
- name: Cache /.yarn/cache
uses: actions/cache@v2
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install
run: yarn
- name: Check
if: ${{ matrix.node-version == '14' }}
run: yarn tsc
- name: Lint
if: ${{ matrix.node-version == '14' }}
run: yarn lint
- name: Test
run: yarn test
release:
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: 14
- name: Checkout
uses: actions/[email protected]
- name: Cache /.yarn/cache
uses: actions/cache@v2
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install
run: yarn
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release