Skip to content

Commit 93742f0

Browse files
authored
feat: add github ci and build workflows (#18)
* feat: add github ci and build workflows * fix: pnpm version * fix: type check fail * chore: remove lint ci * feat: update build on
1 parent 6c2b48f commit 93742f0

File tree

4 files changed

+98
-3
lines changed

4 files changed

+98
-3
lines changed

.github/workflows/build.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- synchronize
7+
branches:
8+
- master
9+
push:
10+
branches:
11+
- master
12+
13+
env:
14+
HUSKY: '0'
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
18+
cancel-in-progress: true
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
post-update:
25+
runs-on: ${{ matrix.os }}
26+
strategy:
27+
matrix:
28+
os:
29+
- ubuntu-latest
30+
# - macos-latest
31+
- windows-latest
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
37+
38+
- name: Setup pnpm
39+
uses: pnpm/action-setup@v2
40+
with:
41+
version: 10
42+
run_install: true
43+
44+
- name: Setup Node.js
45+
uses: actions/setup-node@v4
46+
with:
47+
node-version: 22
48+
cache: pnpm
49+
50+
- name: Build
51+
run: |
52+
pnpm build:antd

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
check:
14+
name: Check
15+
runs-on: ${{ matrix.os }}
16+
timeout-minutes: 20
17+
strategy:
18+
matrix:
19+
os:
20+
- ubuntu-latest
21+
# - macos-latest
22+
- windows-latest
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Setup pnpm
30+
uses: pnpm/action-setup@v2
31+
with:
32+
version: 10
33+
run_install: true
34+
35+
- name: Setup Node.js
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: 22
39+
cache: pnpm
40+
41+
- name: Typecheck
42+
run: pnpm check:type

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ vite.config.ts.*
5353
# 升级 vben 时需要删除的文件
5454
.vscode
5555
.changeset
56-
.github
5756
backend-mock
5857
web-ele
5958
web-naive

apps/web-antd/src/store/auth.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { Recordable } from '@vben/types';
2+
13
import type { CaptchaResult, LoginParams, MyUserInfo } from '#/api';
24

35
import { ref } from 'vue';
@@ -39,14 +41,14 @@ export const useAuthStore = defineStore('auth', () => {
3941
* @param params 登录表单数据
4042
*/
4143
async function authLogin(
42-
params: LoginParams,
44+
params: Recordable<any>,
4345
onSuccess?: () => Promise<void> | void,
4446
) {
4547
// 异步处理用户登录操作并获取 accessToken
4648
let userInfo: MyUserInfo | null = null;
4749
try {
4850
loginLoading.value = true;
49-
const { access_token } = await loginApi(params);
51+
const { access_token } = await loginApi(params as LoginParams);
5052

5153
// 如果成功获取到 accessToken
5254
if (access_token) {

0 commit comments

Comments
 (0)