Skip to content

Commit 38fc2e5

Browse files
committed
💚 Make worktree clean when build
1 parent d4966bb commit 38fc2e5

File tree

4 files changed

+196
-176
lines changed

4 files changed

+196
-176
lines changed

.github/actions/test/action.yml

Lines changed: 1 addition & 176 deletions
Original file line numberDiff line numberDiff line change
@@ -4,182 +4,7 @@ description: Test yutu
44
runs:
55
using: composite
66
steps:
7-
- uses: actions/checkout@v4
8-
- uses: actions/setup-go@v5
9-
with:
10-
go-version-file: ./go.mod
117
- shell: bash
128
run: |
139
go test -v ./...
14-
15-
MOD="github.com/eat-pray-ai/yutu/cmd"
16-
Version="${MOD}.Version=$(git describe --tags --always --dirty | cut -c2-)"
17-
Commit="${MOD}.Commit=$(git rev-parse --short HEAD)"
18-
CommitDate="${MOD}.CommitDate=$(git log -1 --date='format:%Y-%m-%d/%H.%M.%S' --pretty=%cd)"
19-
Os="${MOD}.Os=linux"
20-
Arch="${MOD}.Arch=$(go env GOARCH)"
21-
ldflags="-s -X ${Version} -X ${Commit} -X ${CommitDate} -X ${Os} -X ${Arch}"
22-
go mod download
23-
go build -ldflags "${ldflags}" -o yutu .
24-
chmod +x yutu
25-
- shell: bash
26-
run: |
27-
./yutu help
28-
./yutu completion
29-
30-
echo "======= activity ======="
31-
./yutu activity --help
32-
echo "------- list -------"
33-
./yutu activity list --help
34-
35-
echo "======= caption ======="
36-
./yutu caption --help
37-
echo "------- delete -------"
38-
./yutu caption delete --help
39-
echo "------- insert -------"
40-
./yutu caption insert --help
41-
echo "------- list -------"
42-
./yutu caption list --help
43-
echo "------- update -------"
44-
./yutu caption update --help
45-
echo "------- download -------"
46-
./yutu caption download --help
47-
48-
echo "======= channel ======="
49-
./yutu channel --help
50-
echo "------- list -------"
51-
./yutu channel list --help
52-
echo "------- update -------"
53-
./yutu channel update --help
54-
55-
echo "======= channelBanner ======="
56-
./yutu channelBanner --help
57-
echo "------- insert -------"
58-
./yutu channelBanner insert --help
59-
60-
echo "======= channelSection ======="
61-
./yutu channelSection --help
62-
echo "------- delete -------"
63-
./yutu channelSection delete --help
64-
echo "------- insert -------"
65-
./yutu channelSection list --help
66-
67-
echo "======= comment ======="
68-
./yutu comment --help
69-
echo "------- delete -------"
70-
./yutu comment delete --help
71-
echo "------- insert -------"
72-
./yutu comment insert --help
73-
echo "------- list -------"
74-
./yutu comment list --help
75-
echo "------- markAsSpam -------"
76-
./yutu comment markAsSpam --help
77-
echo "------- setModerationStatus -------"
78-
./yutu comment setModerationStatus --help
79-
echo "------- update -------"
80-
./yutu comment update --help
81-
82-
echo "======= commentThread ======="
83-
./yutu commentThread --help
84-
echo "------- list -------"
85-
./yutu commentThread list --help
86-
echo "------- insert -------"
87-
./yutu commentThread insert --help
88-
89-
echo "======= i18nLanguage ======="
90-
./yutu i18nLanguage --help
91-
echo "------- list -------"
92-
./yutu i18nLanguage list --help
93-
94-
echo "======= i18nRegion ======="
95-
./yutu i18nRegion --help
96-
echo "------- list -------"
97-
./yutu i18nRegion list --help
98-
99-
echo "======= member ======="
100-
./yutu member --help
101-
echo "------- list -------"
102-
./yutu member list --help
103-
104-
echo "======= membershipsLevel ======="
105-
./yutu membershipsLevel --help
106-
echo "------- list -------"
107-
./yutu membershipsLevel list --help
108-
109-
echo "======= playlist ======="
110-
./yutu playlist --help
111-
echo "------- delete -------"
112-
./yutu playlist delete --help
113-
echo "------- insert -------"
114-
./yutu playlist insert --help
115-
echo "------- list -------"
116-
./yutu playlist list --help
117-
echo "------- update -------"
118-
./yutu playlist update --help
119-
120-
echo "======= playlistItem ======="
121-
./yutu playlistItem --help
122-
echo "------- delete -------"
123-
./yutu playlistItem delete --help
124-
echo "------- insert -------"
125-
./yutu playlistItem insert --help
126-
echo "------- list -------"
127-
./yutu playlistItem list --help
128-
echo "------- update -------"
129-
./yutu playlistItem update --help
130-
131-
echo "======= search ======="
132-
./yutu search --help
133-
echo "------- list -------"
134-
./yutu search list --help
135-
136-
echo "======= subscription ======="
137-
./yutu subscription --help
138-
echo "------- delete -------"
139-
./yutu subscription delete --help
140-
echo "------- insert -------"
141-
./yutu subscription insert --help
142-
echo "------- list -------"
143-
./yutu subscription list --help
144-
145-
echo "======= thumbnail ======="
146-
./yutu thumbnail --help
147-
echo "------- set -------"
148-
./yutu thumbnail set --help
149-
150-
echo "======= version ======="
151-
./yutu version --help
152-
153-
echo "======= video ======="
154-
./yutu video --help
155-
echo "------- delete -------"
156-
./yutu video delete --help
157-
echo "------- getRating -------"
158-
./yutu video getRating --help
159-
echo "------- insert -------"
160-
./yutu video insert --help
161-
echo "------- list -------"
162-
./yutu video list --help
163-
echo "------- rate -------"
164-
./yutu video rate --help
165-
echo "------- update -------"
166-
./yutu video update --help
167-
echo "------- reportAbuse -------"
168-
./yutu video reportAbuse --help
169-
170-
echo "======= videoAbuseReport ======="
171-
./yutu videoAbuseReportReason --help
172-
echo "------- list -------"
173-
./yutu videoAbuseReportReason list --help
174-
175-
echo "======= videoCategory ======="
176-
./yutu videoCategory --help
177-
echo "------- list -------"
178-
./yutu videoCategory list --help
179-
180-
echo "======= watermark ======="
181-
./yutu watermark --help
182-
echo "------- set -------"
183-
./yutu watermark set --help
184-
echo "------- unset -------"
185-
./yutu watermark unset --help
10+
./scripts/command-test.sh

.github/workflows/publish.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ jobs:
1111
goreleaser:
1212
runs-on: ubuntu-latest
1313
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
- uses: actions/setup-go@v5
18+
with:
19+
go-version-file: ./go.mod
1420
- name: Test
1521
uses: eat-pray-ai/yutu/.github/actions/test@main
1622
- name: Run goreleaser

.github/workflows/test.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,23 @@ on:
99
- 'go.mod'
1010
- 'main.go'
1111
- '.github/actions/test/**'
12+
- 'scripts/**'
1213
pull_request:
1314
paths:
1415
- 'cmd/**'
1516
- 'pkg/**'
1617
- 'go.mod'
1718
- 'main.go'
1819
- '.github/actions/test/**'
20+
- 'scripts/**'
1921

2022
jobs:
2123
test:
2224
runs-on: ubuntu-latest
25+
if: !startsWith(github.ref, 'refs/tags/')
2326
steps:
27+
- uses: actions/checkout@v4
28+
- uses: actions/setup-go@v5
29+
with:
30+
go-version-file: ./go.mod
2431
- uses: eat-pray-ai/yutu/.github/actions/test@main

0 commit comments

Comments
 (0)