forked from nicojs/typed-html
-
-
Notifications
You must be signed in to change notification settings - Fork 36
114 lines (89 loc) · 2.68 KB
/
ci.yml
File metadata and controls
114 lines (89 loc) · 2.68 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: CI Flow
on:
push:
branches:
- master
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
pages: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
name: CI ${{ matrix.os }} Node ${{ matrix.node }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node: [lts/-2, lts/-1, lts/*]
# Set an environment variable to distinguish cache for each OS/Node
# and distinguish between CI matrix runs in turbo.json
env:
TURBO_OS_ENV: ${{ matrix.os }}
TURBO_NODE_ENV: ${{ matrix.node }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup node and restore cached dependencies
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
- run: echo "Using Node $(node --version) on ${{ matrix.os }}"
- name: Install packages
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build-all
- name: Check types
run: pnpm test-types
- name: Test
run: pnpm test
- name: Publish to Codecov
uses: codecov/codecov-action@v5
if: ${{ matrix.os != 'windows-latest' }}
with:
# Codecov backend may be unstable
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
deploy-docs:
needs: build
if: ${{ github.head_ref == 'next' || github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
name: Deploy Docs
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup node and restore cached dependencies
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install packages
run: pnpm install --frozen-lockfile
- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Build docs
run: pnpm turbo build -F @kitajs/docs-html
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: packages/docs/dist
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4