Skip to content

feat: add github ci and build workflows #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build
on:
pull_request:
types:
- opened
- synchronize
branches:
- master
push:
branches:
- master

env:
HUSKY: '0'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
contents: read

jobs:
post-update:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
# - macos-latest
- windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 10
run_install: true

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- name: Build
run: |
pnpm build:antd
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
pull_request:
push:
branches:
- master

permissions:
contents: read

jobs:
check:
name: Check
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
matrix:
os:
- ubuntu-latest
# - macos-latest
- windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 10
run_install: true

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- name: Typecheck
run: pnpm check:type
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ vite.config.ts.*
# 升级 vben 时需要删除的文件
.vscode
.changeset
.github
backend-mock
web-ele
web-naive
Expand Down
6 changes: 4 additions & 2 deletions apps/web-antd/src/store/auth.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { Recordable } from '@vben/types';

import type { CaptchaResult, LoginParams, MyUserInfo } from '#/api';

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

// 如果成功获取到 accessToken
if (access_token) {
Expand Down