Skip to content

Commit a40f7ef

Browse files
committed
add github workflow
1 parent 8ec6ce7 commit a40f7ef

File tree

2 files changed

+64
-5
lines changed

2 files changed

+64
-5
lines changed

.github/workflows/ci.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main, dev]
8+
9+
concurrency:
10+
group: ci-${{ github.ref }}-${{ github.workflow }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
node-version: [18.x, 20.x]
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
cache: yarn
29+
cache-dependency-path: yarn.lock
30+
31+
- name: Install dependencies
32+
run: yarn install --frozen-lockfile
33+
34+
- name: Check vue-tsc availability
35+
id: check_vuetsc
36+
run: |
37+
node -e "const p=require('./package.json'); process.exit(p.devDependencies && p.devDependencies['vue-tsc'] || p.dependencies && p.dependencies['vue-tsc'] ? 0 : 1)"
38+
continue-on-error: true
39+
40+
- name: Type check
41+
if: steps.check_vuetsc.outcome == 'success'
42+
run: yarn vue-tsc --noEmit
43+
44+
- name: Check lint script availability
45+
id: check_lint
46+
run: |
47+
node -e "const p=require('./package.json'); process.exit(p.scripts && p.scripts['lint'] ? 0 : 1)"
48+
continue-on-error: true
49+
50+
- name: Lint
51+
if: steps.check_lint.outcome == 'success'
52+
run: yarn lint
53+
54+
- name: Build
55+
env:
56+
CI: true
57+
run: yarn build
58+
59+
- name: Upload build artifact (PR only)
60+
if: ${{ github.event_name == 'pull_request' }}
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: dist-${{ matrix.node-version }}
64+
path: dist

todo.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)