Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
afc97094
Unverified
Commit
afc97094
authored
Dec 25, 2022
by
boojack
Committed by
GitHub
Dec 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update dev config (#857)
parent
05b41804
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
41 deletions
+55
-41
backend-tests.yml
.github/workflows/backend-tests.yml
+45
-0
frontend-tests.yml
.github/workflows/frontend-tests.yml
+3
-34
development.md
docs/development.md
+1
-1
profile.go
server/profile/profile.go
+1
-1
vite.config.ts
web/vite.config.ts
+5
-5
No files found.
.github/workflows/backend-tests.yml
0 → 100644
View file @
afc97094
name
:
Backend Test
on
:
push
:
branches
:
-
main
-
"
release/v*.*.*"
pull_request
:
branches
:
[
main
]
paths-ignore
:
-
"
web/**"
jobs
:
go-static-checks
:
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@v3
-
uses
:
actions/setup-go@v3
with
:
go-version
:
1.19
check-latest
:
true
cache
:
true
-
name
:
Verify go.mod is tidy
run
:
|
go mod tidy -go=1.19
git diff --exit-code
-
name
:
golangci-lint
uses
:
golangci/golangci-lint-action@v3
with
:
args
:
-v
skip-cache
:
true
go-tests
:
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@v3
-
uses
:
actions/setup-go@v3
with
:
go-version
:
1.19
check-latest
:
true
cache
:
true
-
name
:
Run all tests
run
:
go test -v ./... | tee test.log; exit ${PIPESTATUS[0]}
-
name
:
Pretty print tests running time
run
:
grep --color=never -e '--- PASS:' -e '--- FAIL:' test.log | sed 's/[:()]//g' | awk '{print $2,$3,$4}' | sort -t' ' -nk3 -r | awk '{sum += $3; print $1,$2,$3,sum"s"}'
.github/workflows/tests.yml
→
.github/workflows/
frontend-
tests.yml
View file @
afc97094
name
:
Test
name
:
Frontend
Test
on
:
on
:
push
:
push
:
...
@@ -7,6 +7,8 @@ on:
...
@@ -7,6 +7,8 @@ on:
-
"
release/v*.*.*"
-
"
release/v*.*.*"
pull_request
:
pull_request
:
branches
:
[
main
]
branches
:
[
main
]
paths
:
-
"
web/**"
jobs
:
jobs
:
eslint-checks
:
eslint-checks
:
...
@@ -53,36 +55,3 @@ jobs:
...
@@ -53,36 +55,3 @@ jobs:
-
name
:
Run frontend build
-
name
:
Run frontend build
run
:
yarn build
run
:
yarn build
working-directory
:
web
working-directory
:
web
go-static-checks
:
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@v3
-
uses
:
actions/setup-go@v3
with
:
go-version
:
1.19
check-latest
:
true
cache
:
true
-
name
:
Verify go.mod is tidy
run
:
|
go mod tidy -go=1.19
git diff --exit-code
-
name
:
golangci-lint
uses
:
golangci/golangci-lint-action@v3
with
:
args
:
-v
skip-cache
:
true
go-tests
:
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@v3
-
uses
:
actions/setup-go@v3
with
:
go-version
:
1.19
check-latest
:
true
cache
:
true
-
name
:
Run all tests
run
:
go test -v ./... | tee test.log; exit ${PIPESTATUS[0]}
-
name
:
Pretty print tests running time
run
:
grep --color=never -e '--- PASS:' -e '--- FAIL:' test.log | sed 's/[:()]//g' | awk '{print $2,$3,$4}' | sort -t' ' -nk3 -r | awk '{sum += $3; print $1,$2,$3,sum"s"}'
docs/development.md
View file @
afc97094
...
@@ -37,4 +37,4 @@ Memos is built with a curated tech stack. It is optimized for developer experien
...
@@ -37,4 +37,4 @@ Memos is built with a curated tech stack. It is optimized for developer experien
cd web && yarn && yarn dev
cd web && yarn && yarn dev
```
```
Memos should now be running at
[
http://localhost:300
0
](
http://localhost:3000
)
and change either frontend or backend code would trigger live reload.
Memos should now be running at
[
http://localhost:300
1
](
http://localhost:3001
)
and change either frontend or backend code would trigger live reload.
server/profile/profile.go
View file @
afc97094
...
@@ -48,7 +48,7 @@ func checkDSN(dataDir string) (string, error) {
...
@@ -48,7 +48,7 @@ func checkDSN(dataDir string) (string, error) {
func
GetProfile
()
(
*
Profile
,
error
)
{
func
GetProfile
()
(
*
Profile
,
error
)
{
profile
:=
Profile
{}
profile
:=
Profile
{}
flag
.
StringVar
(
&
profile
.
Mode
,
"mode"
,
"dev"
,
"mode of server"
)
flag
.
StringVar
(
&
profile
.
Mode
,
"mode"
,
"dev"
,
"mode of server"
)
flag
.
IntVar
(
&
profile
.
Port
,
"port"
,
808
0
,
"port of server"
)
flag
.
IntVar
(
&
profile
.
Port
,
"port"
,
808
1
,
"port of server"
)
flag
.
StringVar
(
&
profile
.
Data
,
"data"
,
""
,
"data directory"
)
flag
.
StringVar
(
&
profile
.
Data
,
"data"
,
""
,
"data directory"
)
flag
.
Parse
()
flag
.
Parse
()
...
...
web/vite.config.ts
View file @
afc97094
...
@@ -13,22 +13,22 @@ export default defineConfig({
...
@@ -13,22 +13,22 @@ export default defineConfig({
],
],
server
:
{
server
:
{
host
:
"0.0.0.0"
,
host
:
"0.0.0.0"
,
port
:
300
0
,
port
:
300
1
,
proxy
:
{
proxy
:
{
"^/api"
:
{
"^/api"
:
{
target
:
"http://localhost:808
0
/"
,
target
:
"http://localhost:808
1
/"
,
changeOrigin
:
true
,
changeOrigin
:
true
,
},
},
"^/o/"
:
{
"^/o/"
:
{
target
:
"http://localhost:808
0
/"
,
target
:
"http://localhost:808
1
/"
,
changeOrigin
:
true
,
changeOrigin
:
true
,
},
},
"^/h/"
:
{
"^/h/"
:
{
target
:
"http://localhost:808
0
/"
,
target
:
"http://localhost:808
1
/"
,
changeOrigin
:
true
,
changeOrigin
:
true
,
},
},
"^/u/
\\
d*/rss.xml"
:
{
"^/u/
\\
d*/rss.xml"
:
{
target
:
"http://localhost:808
0
/"
,
target
:
"http://localhost:808
1
/"
,
changeOrigin
:
true
,
changeOrigin
:
true
,
},
},
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment