-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (70 loc) · 2.05 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Test
on:
push:
branches:
- '*'
pull_request:
branches:
- master
- develop
jobs:
build:
name: Node unit tests
runs-on: ubuntu-latest
strategy:
matrix:
node: ['14', '16', '18']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache .pnpm-store
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
uses: pnpm/action-setup@v2.4.0
with:
version: 6.23.6
run_install: true
- name: Lint source
run: |
pnpm lint:ci
- name: Build packages
run: |
pnpm build
- name: Run tests
run: |
pnpm test:ci
env:
CI: true
- name: Generate Code Coverage
# only when running in node v16
if: matrix.node == 16
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: 'Consume changesets'
if: github.event_name == 'push' && github.repository == 'ivandotv/fuerte' && matrix.node == 16 && github.ref == 'refs/heads/master'
uses: changesets/action@v1
id: 'changesets'
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm release
commit: version bump
title: Next release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: 'Generate docs'
if: steps.changesets.outputs.published == 'true'
run: pnpm gen:docs
- name: Commit docs
if: steps.changesets.outputs.published == 'true'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'Generate docs'