Skip to content

Commit c735017

Browse files
Merge branch 'doocs:main' into main
2 parents e4bd6ed + 772a22d commit c735017

File tree

10,351 files changed

+488453
-131269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

10,351 files changed

+488453
-131269
lines changed

.github/pull_request_template.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1 @@
11

2-
3-
<!--
4-
Below are template for copilot to generate CR message.
5-
Please DO NOT modify it.
6-
7-
8-
### Description
9-
10-
copilot:summary
11-
12-
### Explanation of Changes
13-
14-
copilot:walkthrough
15-
16-
-->

.github/workflows/black-lint.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
11
name: black-linter
22

33
on:
4-
push: {}
5-
pull_request: {}
4+
push:
5+
paths:
6+
- solution/**
7+
- lcs/**
8+
- lcp/**
9+
- lcof2/**
10+
- lcof/**
11+
- lcci/**
12+
- basic/**
13+
pull_request:
14+
paths:
15+
- solution/**
16+
- lcs/**
17+
- lcp/**
18+
- lcof2/**
19+
- lcof/**
20+
- lcci/**
21+
- basic/**
22+
23+
concurrency:
24+
group: ${{github.workflow}} - ${{github.ref}}
25+
cancel-in-progress: true
626

727
jobs:
828
build:

.github/workflows/clang-format-lint.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
11
name: clang-format-linter
22

33
on:
4-
push: {}
5-
pull_request: {}
4+
push:
5+
paths:
6+
- solution/**
7+
- lcs/**
8+
- lcp/**
9+
- lcof2/**
10+
- lcof/**
11+
- lcci/**
12+
- basic/**
13+
pull_request:
14+
paths:
15+
- solution/**
16+
- lcs/**
17+
- lcp/**
18+
- lcof2/**
19+
- lcof/**
20+
- lcci/**
21+
- basic/**
22+
23+
concurrency:
24+
group: ${{github.workflow}} - ${{github.ref}}
25+
cancel-in-progress: true
626

727
jobs:
828
build:

.github/workflows/compress.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ on:
1818
workflow_dispatch:
1919
schedule:
2020
- cron: '00 23 * * 0'
21+
22+
concurrency:
23+
group: ${{github.workflow}} - ${{github.ref}}
24+
cancel-in-progress: true
25+
2126
jobs:
2227
build:
2328
name: calibreapp/image-actions

.github/workflows/deploy.yml

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,52 @@ on:
44
push:
55
branches:
66
- main
7-
- docs
7+
paths:
8+
- solution/**
9+
- lcs/**
10+
- lcp/**
11+
- lcof2/**
12+
- lcof/**
13+
- lcci/**
14+
- basic/**
815
workflow_dispatch:
916

17+
env:
18+
MKDOCS_API_KEYS: ${{ secrets.MKDOCS_API_KEYS }}
19+
1020
permissions:
1121
contents: write
1222

23+
concurrency:
24+
group: ${{github.workflow}} - ${{github.ref}}
25+
cancel-in-progress: true
26+
1327
jobs:
1428
deploy:
1529
runs-on: ubuntu-latest
30+
if: github.repository == 'doocs/leetcode'
1631
steps:
1732
- uses: actions/checkout@v4
1833
- uses: actions/checkout@v4
1934
with:
2035
ref: docs
2136
path: mkdocs
22-
- run: mv mkdocs/* .
37+
- run: |
38+
mv -f mkdocs/* .
39+
mv solution/CONTEST_README.md docs/contest.md
40+
mv solution/CONTEST_README_EN.md docs-en/contest.md
2341
- name: Configure Git Credentials
2442
run: |
2543
git config user.name github-actions[bot]
2644
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
2745
28-
- uses: actions/setup-python@v4
46+
- uses: actions/setup-python@v5
2947
with:
3048
python-version: 3.x
3149

3250
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
3351

34-
- uses: actions/cache@v3
52+
- uses: actions/cache@v4
3553
with:
3654
key: mkdocs-material-${{ env.cache_id }}
3755
path: .cache
@@ -42,30 +60,37 @@ jobs:
4260
run: |
4361
python3 -m pip install --upgrade pip
4462
python3 -m pip install -r requirements.txt
63+
python3 -m pip install "mkdocs-material[imaging]"
64+
sudo apt-get install pngquant
4565
4666
- run: |
4767
python3 main.py
4868
mkdocs build -f mkdocs.yml
4969
mkdocs build -f mkdocs-en.yml
5070
5171
- name: Deploy
52-
uses: peaceiris/actions-gh-pages@v3
72+
uses: peaceiris/actions-gh-pages@v4
5373
with:
5474
github_token: ${{ secrets.GITHUB_TOKEN }}
5575
publish_dir: ./site
5676

57-
- name: Sync to gitee.com
58-
uses: wearerequired/git-mirror-action@master
59-
env:
60-
SSH_PRIVATE_KEY: ${{ secrets.RSA_PRIVATE_KEY }}
61-
with:
62-
source-repo: [email protected]:doocs/leetcode.git
63-
destination-repo: [email protected]:Doocs/leetcode.git
77+
# sync:
78+
# runs-on: ubuntu-latest
79+
# needs: deploy
80+
# if: github.repository == 'doocs/leetcode'
81+
# steps:
82+
# - name: Sync to gitee.com
83+
# uses: wearerequired/git-mirror-action@master
84+
# env:
85+
# SSH_PRIVATE_KEY: ${{ secrets.RSA_PRIVATE_KEY }}
86+
# with:
87+
# source-repo: [email protected]:doocs/leetcode.git
88+
# destination-repo: [email protected]:Doocs/leetcode.git
6489

65-
- name: Build Gitee Pages
66-
uses: yanglbme/gitee-pages-action@main
67-
with:
68-
gitee-username: yanglbme
69-
gitee-password: ${{ secrets.GITEE_PASSWORD }}
70-
gitee-repo: doocs/leetcode
71-
branch: gh-pages
90+
# - name: Build Gitee Pages
91+
# uses: yanglbme/gitee-pages-action@main
92+
# with:
93+
# gitee-username: yanglbme
94+
# gitee-password: ${{ secrets.GITEE_PASSWORD }}
95+
# gitee-repo: doocs/leetcode
96+
# branch: gh-pages

.github/workflows/pr-add-label.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
pull_request_target:
55
types: [opened, edited, reopened, synchronize]
66

7+
concurrency:
8+
group: ${{github.workflow}} - ${{github.event_name}}
9+
cancel-in-progress: true
10+
711
jobs:
812
add-label:
913
permissions:

.github/workflows/pr-checker.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
pull_request_target:
55
types: [opened]
66

7+
concurrency:
8+
group: ${{github.workflow}} - ${{github.ref}}
9+
cancel-in-progress: true
10+
711
jobs:
812
build:
913
runs-on: ubuntu-latest

.github/workflows/pr-labeled.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: PR Labeled
2+
3+
on:
4+
pull_request_target:
5+
types: [labeled]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
issue-labeled:
12+
permissions:
13+
pull-requests: write # for actions-cool/issues-helper to update PRs
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: supplement
17+
if: github.event.label.name == 'supplement'
18+
uses: actions-cool/issues-helper@v3
19+
with:
20+
actions: "create-comment"
21+
token: ${{ secrets.DOOCS_BOT_ACTION_TOKEN }}
22+
issue-number: ${{ github.event.pull_request.number }}
23+
body: |
24+
@${{ github.event.pull_request.user.login }}, Please add the missing README_EN.md / README.md, please refer to the details for https://github.com/doocs/leetcode/pull/2590/files
25+
26+
@${{ github.event.pull_request.user.login }}, 请补充缺少的 README_EN.md / README.md, 详情参考 https://github.com/doocs/leetcode/pull/2590/files
27+
28+
- name: invalid
29+
if: github.event.label.name == 'invalid'
30+
uses: actions-cool/issues-helper@v3
31+
with:
32+
actions: "create-comment"
33+
token: ${{ secrets.DOOCS_BOT_ACTION_TOKEN }}
34+
issue-number: ${{ github.event.pull_request.number }}
35+
body: |
36+
@${{ github.event.pull_request.user.login }}, Please refer to the project specifications provided by bot to check your PR. For PRs that have not been modified for a long time, we will close them and you are welcome to resubmit or correct them.
37+
38+
@${{ github.event.pull_request.user.login }}, 请参考 bot 提供的项目规范检查你的 PR,我们会关闭长时间未修改的 PR,欢迎你重新提交或更正。

.github/workflows/prettier.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
pull_request_target:
55
types: [opened, edited, reopened, synchronize]
66

7+
concurrency:
8+
group: ${{github.workflow}} - ${{github.ref}}
9+
cancel-in-progress: true
10+
711
jobs:
812
format:
913
permissions:
@@ -17,15 +21,15 @@ jobs:
1721
ref: ${{ github.head_ref }}
1822
fetch-depth: 0
1923
- name: Set up Node.js
20-
uses: actions/setup-node@v3
24+
uses: actions/setup-node@v4
2125
with:
2226
node-version: 18
2327
- name: Install Dependencies
2428
run: npm install
2529
- name: Run prettier
2630
run: |
2731
git config --global core.quotepath off
28-
changed_files=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" | grep -E '\.js$|\.ts$|\.php$|\.sql$|\.rs$|\.md$' || true)
32+
changed_files=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" | grep -E '\.js$|\.ts$|\.php$|\.sql$|\.md$' || true)
2933
if [ -n "$changed_files" ]; then
3034
echo "Running prettier on the changed files"
3135
echo "$changed_files" | xargs -d '\n' npx prettier --write

.gitignore

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
.vscode
44
.temp
55
.cache
6+
*.iml
7+
__pycache__
68
/node_modules
79
/solution/result.json
8-
/solution/contest.json
9-
/solution/contest_list.json
10-
/solution/raw.json
11-
/lcof/lcof.json
12-
/lcof/lcof_list.json
13-
/lcci/lcci.json
1410
/solution/__pycache__
15-
/solution/.env
16-
*.iml
11+
/solution/.env

0 commit comments

Comments
 (0)