Skip to content

Commit 9fc01f6

Browse files
authored
Merge pull request #1 from doocs/main
Able to merge
2 parents 2c82292 + 8ce5ad2 commit 9fc01f6

File tree

14,739 files changed

+786818
-195052
lines changed

Some content is hidden

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

14,739 files changed

+786818
-195052
lines changed

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# REF: https://spec.editorconfig.org/#supported-pairs
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
# tab_width = 4
9+
# end_of_line = lf
10+
charset = utf-8
11+
# spelling_language = en-US
12+
trim_trailing_whitespace = true
13+
insert_final_newline = true
14+
15+
[*.{md}]
16+
trim_trailing_whitespace = false
17+
18+
[*.{go}]
19+
indent_style = tab
20+
21+
[*.{yml,yaml}]
22+
indent_size = 2

.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: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,35 @@
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:
929
runs-on: ubuntu-latest
1030

1131
steps:
1232
- uses: actions/checkout@v4
13-
- uses: jpetrucciani/black-check@master
33+
- uses: jpetrucciani/black-check@24.2.0
1434
with:
1535
black_flags: '-S'

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

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
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:
929
runs-on: ubuntu-latest
1030

1131
steps:
1232
- uses: actions/checkout@v4
13-
- uses: DoozyX/clang-format-lint-action@v0.16.2
33+
- uses: DoozyX/clang-format-lint-action@v0.17
1434
with:
1535
source: '.'
1636
extensions: 'c,cpp,java'

.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: 48 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,52 @@ on:
44
push:
55
branches:
66
- main
7+
paths:
8+
- solution/**
9+
- lcs/**
10+
- lcp/**
11+
- lcof2/**
12+
- lcof/**
13+
- lcci/**
14+
- basic/**
715
workflow_dispatch:
816

17+
env:
18+
MKDOCS_API_KEYS: ${{ secrets.MKDOCS_API_KEYS }}
19+
920
permissions:
1021
contents: write
1122

23+
concurrency:
24+
group: ${{github.workflow}} - ${{github.ref}}
25+
cancel-in-progress: true
26+
1227
jobs:
1328
deploy:
1429
runs-on: ubuntu-latest
30+
if: github.repository == 'doocs/leetcode'
1531
steps:
1632
- uses: actions/checkout@v4
33+
- uses: actions/checkout@v4
34+
with:
35+
ref: docs
36+
path: 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
1741
- name: Configure Git Credentials
1842
run: |
1943
git config user.name github-actions[bot]
2044
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
2145
22-
- uses: actions/setup-python@v4
46+
- uses: actions/setup-python@v5
2347
with:
2448
python-version: 3.x
2549

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

28-
- uses: actions/cache@v3
52+
- uses: actions/cache@v4
2953
with:
3054
key: mkdocs-material-${{ env.cache_id }}
3155
path: .cache
@@ -36,30 +60,37 @@ jobs:
3660
run: |
3761
python3 -m pip install --upgrade pip
3862
python3 -m pip install -r requirements.txt
63+
python3 -m pip install "mkdocs-material[imaging]"
64+
sudo apt-get install pngquant
3965
4066
- run: |
4167
python3 main.py
4268
mkdocs build -f mkdocs.yml
4369
mkdocs build -f mkdocs-en.yml
4470
4571
- name: Deploy
46-
uses: peaceiris/actions-gh-pages@v3
72+
uses: peaceiris/actions-gh-pages@v4
4773
with:
4874
github_token: ${{ secrets.GITHUB_TOKEN }}
4975
publish_dir: ./site
5076

51-
- name: Sync to gitee.com
52-
uses: wearerequired/git-mirror-action@master
53-
env:
54-
SSH_PRIVATE_KEY: ${{ secrets.RSA_PRIVATE_KEY }}
55-
with:
56-
source-repo: [email protected]:doocs/leetcode.git
57-
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
5889

59-
- name: Build Gitee Pages
60-
uses: yanglbme/gitee-pages-action@main
61-
with:
62-
gitee-username: yanglbme
63-
gitee-password: ${{ secrets.GITEE_PASSWORD }}
64-
gitee-repo: doocs/leetcode
65-
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: 0 additions & 24 deletions
This file was deleted.

.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

0 commit comments

Comments
 (0)