Skip to content

Commit d4ee191

Browse files
authored
Merge pull request #164 from IDEA-Research/feature/simplify_project
feat: simplify project
2 parents 4d188ed + d879489 commit d4ee191

13 files changed

Lines changed: 50 additions & 296 deletions

File tree

.github/workflows/app-cd.yaml

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

.github/workflows/sync-dev.yml

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

.github/workflows/tool-ci.yaml

Lines changed: 25 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,17 @@ name: tool-ci
22
on:
33
push:
44
branches:
5-
- '**'
6-
tags:
7-
- ''
5+
- main
6+
pull_request:
7+
branches:
8+
- dev
89
jobs:
9-
scan:
10-
runs-on: self-hosted
11-
steps:
12-
- name: Checkout Code
13-
uses: actions/checkout@v3
14-
with:
15-
fetch-depth: 0
16-
- name: Scan Code
17-
uses: sonarsource/sonarqube-scan-action@master
18-
env:
19-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
20-
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
21-
with:
22-
args: >
23-
-Dsonar.projectKey=dds-tool
24-
test_on_windows_2019:
25-
if: github.repository_owner == 'IDEA-Research'
26-
needs: scan
27-
runs-on: windows-2019
28-
steps:
29-
- name: Checkout Code
30-
uses: actions/checkout@v3
31-
with:
32-
fetch-depth: 0
33-
- name: Setup Python 3.10
34-
uses: actions/setup-python@v4
35-
with:
36-
python-version: '3.10'
37-
cache: 'pip'
38-
cache-dependency-path: 'requirements-dev.txt'
39-
- name: Run Test
40-
run: |
41-
pip install -r requirements-dev.txt
42-
pytest --cov=deepdataspace -s --cov-report=xml
43-
test_on_windows_2022:
44-
if: github.repository_owner == 'IDEA-Research'
45-
needs: scan
46-
runs-on: windows-2022
47-
steps:
48-
- name: Checkout Code
49-
uses: actions/checkout@v3
50-
with:
51-
fetch-depth: 0
52-
- name: Setup Python 3.10
53-
uses: actions/setup-python@v4
54-
with:
55-
python-version: '3.10'
56-
cache: 'pip'
57-
cache-dependency-path: 'requirements-dev.txt'
58-
- name: Run Test
59-
run: |
60-
pip install -r requirements-dev.txt
61-
pytest --cov=deepdataspace -s --cov-report=xml
62-
test_on_macos_12:
63-
if: github.repository_owner == 'IDEA-Research'
64-
needs: scan
65-
runs-on: macos-12
10+
test_python:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [windows-2022, macos-12, ubuntu-22.04]
6616
steps:
6717
- name: Checkout Code
6818
uses: actions/checkout@v3
@@ -71,44 +21,34 @@ jobs:
7121
- name: Setup Python 3.10
7222
uses: actions/setup-python@v4
7323
with:
74-
python-version: '3.10'
75-
cache: 'pip'
76-
cache-dependency-path: 'requirements-dev.txt'
77-
- name: Run Test
78-
run: |
79-
pip install -r requirements-dev.txt
80-
pytest --cov=deepdataspace -s --cov-report=xml
81-
test_on_ubuntu_2204:
82-
if: github.repository_owner == 'IDEA-Research'
83-
needs: [test_on_windows_2019, test_on_windows_2022, test_on_macos_12 ]
84-
runs-on: ubuntu-22.04
85-
steps:
86-
- name: Checkout Code
87-
uses: actions/checkout@v3
88-
with:
89-
fetch-depth: 0
90-
- name: Setup Python 3.10
91-
uses: actions/setup-python@v4
92-
with:
93-
python-version: '3.10'
94-
cache: 'pip'
95-
cache-dependency-path: 'requirements-dev.txt'
24+
python-version: "3.10"
25+
cache: "pip"
26+
cache-dependency-path: "requirements-dev.txt"
9627
- name: Run Test
9728
run: |
9829
pip install -r requirements-dev.txt
9930
pytest --cov=deepdataspace -s --cov-report=xml
10031
- name: Upload Test Report
10132
uses: codecov/codecov-action@v3
33+
if: matrix.os == 'ubuntu-22.04'
10234
with:
10335
token: ${{ secrets.CODECOV_TOKEN }}
10436
fail_ci_if_error: true
10537
verbose: true
10638
flags: backend
10739
test_frontend:
108-
if: github.repository_owner == 'IDEA-Research'
109-
runs-on: self-hosted
40+
runs-on: ubuntu-22.04
41+
env:
42+
TZ: Asia/Shanghai
11043
steps:
111-
- uses: actions/checkout@v1
44+
- uses: actions/checkout@v3
45+
- name: Setup Node.js
46+
uses: actions/setup-node@v4
47+
with:
48+
node-version: "20"
49+
- name: Setup pnpm
50+
uses: pnpm/action-setup@v4
51+
with: {}
11252
- name: Install requirements
11353
run: pnpm install --frozen-lockfile
11454
- name: Run pnpm audit

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ venv
88
.DS_Store
99
/config.py
1010
.python-version
11+
.venv-dds
12+
.dds-home
13+
.pypirc
1114

1215
# for runtime file
1316
/data

deepdataspace/server/static/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
</head>
1010
<body>
1111
<div id="root"></div>
12-
<script src="/static/umi.c30875f2.js"></script>
12+
<script src="/static/umi.daf451b9.js"></script>
1313

1414
</body></html>

deepdataspace/server/static/umi.c30875f2.js renamed to deepdataspace/server/static/umi.daf451b9.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deepdataspace/server/templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
</head>
1010
<body>
1111
<div id="root"></div>
12-
<script src="/static/umi.c30875f2.js"></script>
12+
<script src="/static/umi.daf451b9.js"></script>
1313

1414
</body></html>

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "deepdataspace",
33
"private": true,
4+
"packageManager": "pnpm@8.15.9",
45
"scripts": {
56
"update:app": "chmod +x ./build_frontend.sh && ./build_frontend.sh",
67
"build:app": "pnpm run --filter app build",

packages/app/src/models/user.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ export default () => {
8080
setUser({ isLogin: false });
8181
message.success(globalLocaleText('logoutSuccess'));
8282
localStorage.removeItem(STORAGE_KEY.AUTH_TOKEN);
83-
history.push('/');
83+
// In unit tests (or non-umi runtime), `history` can be undefined.
84+
history?.push?.('/');
8485
} catch (error) {
8586
console.error('error', error);
8687
message.error(globalLocaleText('logoutFailed'));

packages/app/tests/models/user.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ describe('useModel user', () => {
7979
await result.current.checkLoginStatus();
8080
expect(fetchUserInfo).toHaveBeenCalledTimes(1);
8181
});
82-
act(async () => {
83-
result.current.limitLoginAction();
82+
await act(async () => {
83+
await result.current.limitLoginAction();
8484
});
8585
expect(result.current.user.isLogin).toEqual(true);
8686
});

0 commit comments

Comments
 (0)