-
Notifications
You must be signed in to change notification settings - Fork 8
96 lines (75 loc) · 2.2 KB
/
ci.yml
File metadata and controls
96 lines (75 loc) · 2.2 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
# Copyright 2015 Shuai Zhang
# SPDX-License-Identifier: LGPL-3.0-or-later WITH LGPL-3.0-linking-exception
name: Continuous Integration
on:
pull_request:
branches:
- main
push:
branches:
- main
permissions:
contents: read
jobs:
validation:
name: Validate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Mise Install Tools
uses: jdx/mise-action@v3
with:
experimental: true
install_args: 'hk pkl typos go:github.com/B1NARY-GR0UP/nwa'
- name: Set up PNPM
uses: pnpm/action-setup@v4
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 22.x
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Validate with HK
if: github.event_name == 'push'
run: |
BASE="${{ github.event.before }}"
HEAD="${{ github.sha }}"
echo "hk check from $BASE to $HEAD"
hk check --check --from-ref "$BASE" --to-ref "$HEAD"
- name: Validate with HK
if: github.event_name == 'pull_request'
run: |
BASE="${{ github.event.pull_request.base.sha }}"
HEAD="${{ github.event.pull_request.head.sha }}"
echo "hk check from $BASE to $HEAD"
hk check --check --from-ref "$BASE" --to-ref "$HEAD"
- name: Validate with PNPM
run: pnpm lint && pnpm typecheck
test:
name: Test & Build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.19.0, 20.x, 22.x, 24.x]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up PNPM
uses: pnpm/action-setup@v4
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run tests
run: pnpm run test
- name: Build
run: pnpm run build