返回 slidev
test.yml
根目录 / .github / workflows / test.yml
1 name: Test
2
3 on:
4 push:
5 branches:
6 - main
7 - master
8
9 pull_request:
10 branches:
11 - main
12 - master
13
14 jobs:
15 test:
16 timeout-minutes: 10
17 runs-on: ${{ matrix.os }}
18
19 strategy:
20 matrix:
21 node-version: [lts/*]
22 os: [ubuntu-latest, windows-latest, macos-latest]
23 # os: [ubuntu-latest, macos-latest]
24 fail-fast: false
25
26 steps:
27 - name: Set git to use LF
28 run: |
29 git config --global core.autocrlf false
30 git config --global core.eol lf
31
32 - uses: actions/checkout@v6
33
34 - name: Setup pnpm
35 uses: pnpm/action-setup@v4
36
37 - name: Use Node.js ${{ matrix.node-version }}
38 uses: actions/setup-node@v6
39 with:
40 node-version: ${{ matrix.node-version }}
41 cache: pnpm
42
43 - name: Setup
44 run: npm i -g @antfu/ni
45
46 - name: Install
47 run: nci
48 env:
49 CYPRESS_INSTALL_BINARY: 0
50
51 - name: Build
52 run: nr build
53
54 - name: Test
55 run: nr test
56
57 typecheck:
58 runs-on: ubuntu-latest
59 timeout-minutes: 10
60 steps:
61 - uses: actions/checkout@v6
62 - name: Setup pnpm
63 uses: pnpm/action-setup@v4
64 - name: Use Node.js lts/*
65 uses: actions/setup-node@v6
66 with:
67 node-version: lts/*
68 cache: pnpm
69 - name: Setup
70 run: npm i -g @antfu/ni
71 - name: Install
72 run: nci
73 env:
74 CYPRESS_INSTALL_BINARY: 0
75 - name: Build
76 run: nr build
77 - name: Typecheck
78 run: nr typecheck
79
80 cypress:
81 runs-on: ubuntu-latest
82 timeout-minutes: 20
83
84 steps:
85 - uses: actions/checkout@v6
86
87 - name: Setup pnpm
88 uses: pnpm/action-setup@v4
89
90 - uses: actions/setup-node@v6
91 with:
92 node-version: lts/*
93 cache: pnpm
94
95 - name: Setup
96 run: npm i -g @antfu/ni
97
98 - name: Install
99 run: nci
100
101 - name: Build
102 run: nr build
103
104 - name: Hack Cypress
105 run: cp pnpm-lock.yaml package-lock.json
106
107 - name: Cypress
108 uses: cypress-io/github-action@v7
109 with:
110 install-command: echo
111 build: nr build
112 start: nr cy:fixture
113
113 lines YAML