This commit is contained in:
31
.github/workflows/build_publish_develop_docs.yml
vendored
Normal file
31
.github/workflows/build_publish_develop_docs.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Build/Publish Develop Docs
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
permissions:
|
||||
contents: write
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Configure Git Credentials
|
||||
run: |
|
||||
git config user.name github-actions[bot]
|
||||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.x
|
||||
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
key: mkdocs-material-${{ env.cache_id }}
|
||||
path: .cache
|
||||
restore-keys: |
|
||||
mkdocs-material-
|
||||
- run: pip install mike mkdocs-material jieba mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-static-i18n
|
||||
- run: |
|
||||
git fetch origin gh-pages --depth=1
|
||||
mike deploy --push --update-aliases main latest
|
||||
31
.github/workflows/build_publish_release_docs.yml
vendored
Normal file
31
.github/workflows/build_publish_release_docs.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Build/Publish Release Docs
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Configure Git Credentials
|
||||
run: |
|
||||
git config user.name github-actions[bot]
|
||||
git config user.email github-actions[bot]@users.noreply.github.com
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.x
|
||||
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
key: mkdocs-material-${{ env.cache_id }}
|
||||
path: .cache
|
||||
restore-keys: |
|
||||
mkdocs-material-
|
||||
- run: pip install mike mkdocs-material jieba mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-static-i18n
|
||||
- run: |
|
||||
git fetch origin gh-pages --depth=1
|
||||
mike deploy --push "${{ github.ref_name }}"
|
||||
23
.github/workflows/close_inactive_issues.yaml
vendored
Normal file
23
.github/workflows/close_inactive_issues.yaml
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
name: Close inactive issues
|
||||
on:
|
||||
schedule:
|
||||
- cron: "30 1 * * *"
|
||||
|
||||
jobs:
|
||||
close-issues:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
days-before-issue-stale: 90
|
||||
days-before-issue-close: 14
|
||||
stale-issue-label: "stale"
|
||||
stale-issue-message: "This issue is stale because it has been open for 90 days with no activity."
|
||||
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
|
||||
days-before-pr-stale: -1
|
||||
days-before-pr-close: -1
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
36
.github/workflows/codestyle.yml
vendored
Normal file
36
.github/workflows/codestyle.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: PaddleOCR Code Style Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: ['main', 'release/*']
|
||||
|
||||
jobs:
|
||||
check-code-style:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Cache Python dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Install Dependencies for Python
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install "clang-format==13.0.0"
|
||||
|
||||
- uses: pre-commit/action@v3.0.1
|
||||
with:
|
||||
extra_args: '--all-files'
|
||||
39
.github/workflows/python-publish.yml
vendored
Normal file
39
.github/workflows/python-publish.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
# This workflow will upload a Python Package using Twine when a release is created
|
||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
|
||||
|
||||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by
|
||||
# separate terms of service, privacy policy, and support
|
||||
# documentation.
|
||||
|
||||
name: Upload Python Package
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install build==1.2.2
|
||||
- name: Build package
|
||||
run: python -m build
|
||||
- name: Publish package
|
||||
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||
73
.github/workflows/test_gpu.yml
vendored
Normal file
73
.github/workflows/test_gpu.yml
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
name: PaddleOCR PR Tests GPU
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- '**.txt'
|
||||
- '**.yml'
|
||||
- '**.yaml'
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- '**.txt'
|
||||
- '**.yml'
|
||||
- '**.yaml'
|
||||
workflow_dispatch:
|
||||
env:
|
||||
PR_ID: ${{ github.event.pull_request.number }}
|
||||
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
|
||||
work_dir: /workspace/PaddleOCR
|
||||
PADDLENLP_ROOT: /workspace/PaddleOCR
|
||||
TASK: paddleocr-CI-${{ github.event.pull_request.number }}
|
||||
BRANCH: ${{ github.event.pull_request.base.ref }}
|
||||
AGILE_COMPILE_BRANCH: ${{ github.event.pull_request.base.ref }}
|
||||
DIR_NAME: ${{ github.repository }}
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test-pr-gpu:
|
||||
runs-on: [self-hosted, GPU-2Card-OCR]
|
||||
steps:
|
||||
- name: run test
|
||||
env:
|
||||
py_version: "3.10"
|
||||
paddle_whl: https://paddle-qa.bj.bcebos.com/paddle-pipeline/Develop-GpuSome-LinuxCentos-Gcc82-Cuda118-Cudnn86-Trt85-Py310-CINN-Compile/latest/paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl
|
||||
docker_image: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddle:latest-dev-cuda11.8-cudnn8.6-trt8.5-gcc82
|
||||
run: |
|
||||
work_dir=$RANDOM
|
||||
mkdir $work_dir
|
||||
cd $work_dir
|
||||
git clone --depth=1 https://github.com/PaddlePaddle/PaddleOCR.git -b main
|
||||
cd PaddleOCR
|
||||
git fetch origin pull/${PR_ID}/head:ci_build
|
||||
git checkout ci_build
|
||||
docker run --gpus all --rm -i --name PaddleOCR_CI_$RANDOM \
|
||||
--shm-size=128g --net=host \
|
||||
-v $PWD:/workspace -w /workspace \
|
||||
-e "py_version=${py_version}" \
|
||||
-e "paddle_whl=${paddle_whl}" \
|
||||
${docker_image} /bin/bash -c '
|
||||
ldconfig;
|
||||
nvidia-smi
|
||||
df -hl
|
||||
|
||||
echo ${py_version}
|
||||
rm -rf run_env
|
||||
mkdir run_env
|
||||
ln -s $(which python${py_version}) run_env/python
|
||||
ln -s $(which python${py_version}) run_env/python3
|
||||
ln -s $(which pip${py_version}) run_env/pip
|
||||
export PATH=$PWD/run_env:${PATH}
|
||||
|
||||
python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
|
||||
python -c "import paddle; paddle.version.show()"
|
||||
python -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
python -m pip install pytest
|
||||
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; fi
|
||||
python -m pip install -e .
|
||||
python -m pytest --verbose tests/
|
||||
'
|
||||
53
.github/workflows/tests.yaml
vendored
Normal file
53
.github/workflows/tests.yaml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
name: PaddleOCR PR Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main", "release/*"]
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- '**.txt'
|
||||
- '**.yml'
|
||||
- '**.yaml'
|
||||
pull_request:
|
||||
branches: ["main", "release/*"]
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- '**.txt'
|
||||
- '**.yml'
|
||||
- '**.yaml'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test-pr:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python 3.10
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.10"
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/pip
|
||||
~/.local/lib/python3.10/site-packages
|
||||
~/.paddleocr/
|
||||
key: ${{ runner.os }}-dependencies-${{ hashFiles('**/requirements.txt', 'pyproject.toml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-dependencies-
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install pytest
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
python -m pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/
|
||||
pip install -e .
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
pytest --verbose tests/
|
||||
Reference in New Issue
Block a user