Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into edgchen1/build_py_roo…
Browse files Browse the repository at this point in the history
…t_user_check
  • Loading branch information
edgchen1 committed Mar 25, 2023
2 parents e6db2d9 + 5a2e43b commit 024d69d
Show file tree
Hide file tree
Showing 594 changed files with 5,441 additions and 6,126 deletions.
27 changes: 0 additions & 27 deletions .flake8

This file was deleted.

2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ep:tvm: '/\btvm\b/i'
ep:VitisAI: '/\bvitis(?:ai)?\b/i'
platform:jetson: '/\bjetson\b/i'
platform:mobile: '/(\bobj(?:ective)?-?c\b|\bnnapi\b|\bcore-?ml\b|\bmobile\b|\bandroid\b|\bios\b|\bxamarin\b|\bmaui\b)/i'
platform:web: '/(\bwebgl\b|\bwasm\b)/i'
platform:web: '/(\bwebgl\b|\bweb-?gpu\b|\bwasm\b|\bonnxruntime-node\b|\bonnxruntime-web\b)/i'
platform:windows: '/(\bwindows\b|\bwinrt\b|\bwinml\b)/i'
model:transformer: '/(\bbert\b|\bgpt-?2\b|\bhugging-?face\b|\blong-?former\b|\bt5\b)/i'
quantization: '/(is this a quantized model\?\n\nYes|\bquantization\b)/i'
2 changes: 1 addition & 1 deletion .github/workflows/generate-skip-doc-change.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
GITHUB_DIR = Path(__file__).resolve().parent.parent


class Skipped_Workflow:
class Skipped_Workflow: # noqa: N801
def __init__(self, workflow_name: str, job_names: list, output_file_name: str):
self.workflow_name = workflow_name
self.job_names = job_names
Expand Down
90 changes: 34 additions & 56 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,11 @@ on:
pull_request:

jobs:
lint-python:
name: Lint Python
optional-lint:
name: Optional Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: flake8
uses: reviewdog/action-flake8@v3
with:
github_token: ${{ secrets.github_token }}
# Change reviewdog reporter if you need [github-pr-check, github-check, github-pr-review].
reporter: github-pr-check
# Change reporter level if you need.
# GitHub Status Check won't become failure with a warning.
level: error
filter_mode: file
- name: pyflakes
uses: reviewdog/action-pyflakes@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-check
level: warning
- uses: actions/checkout@v3
- name: misspell # Check spellings as well
uses: reviewdog/action-misspell@v1
with:
Expand All @@ -44,43 +28,44 @@ jobs:
reporter: github-pr-check
level: info
filter_mode: file
- name: pyright
uses: jordemort/action-pyright@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-check
level: warning
filter_mode: added
lib: true
pyright_version: 1.1.291
- name: pylint
uses: dciborow/[email protected]
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-check
level: warning
filter_mode: diff_context
glob_pattern: "**/*.py"

lint-python-format:
# Separated black/isort from other Python linters because we want this job to
# fail and not affect other linters
# According to https://black.readthedocs.io/en/stable/integrations/github_actions.html:
# We recommend the use of the @stable tag, but per version tags also exist if you prefer that.
# Note that the action’s version you select is independent of the version of Black the action will use.
# The version of Black the action will use can be configured via version.
# Required workflow
name: Python format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
# Version range or exact version of Python to use, using SemVer's version range syntax. Reads from .python-version if unset.
python-version: "3.10"
- uses: psf/black@stable
- name: Install dependencies
run: |
python -m pip install -r requirements-dev.txt
python -m pip install lintrunner lintrunner-adapters
lintrunner init
- name: Run lintrunner on all files
run: |
set +e
if ! lintrunner --force-color --all-files --tee-json=lint.json -v; then
echo ""
echo -e "\e[1m\e[36mYou can reproduce these results locally by using \`lintrunner -m main\`.\e[0m"
exit 1
fi
- name: Produce SARIF
if: always()
run: |
python -m lintrunner_adapters to-sarif lint.json lintrunner.sarif
- name: Upload SARIF file
if: always()
continue-on-error: true
uses: github/codeql-action/upload-sarif@v2
with:
options: "--check --diff --color"
version: "22.12.0"
- uses: isort/isort-action@master
# Path to SARIF file relative to the root of the repository
sarif_file: lintrunner.sarif
category: lintrunner
checkout_path: ${{ github.workspace }}

lint-cpp:
name: Lint C++
Expand All @@ -98,13 +83,6 @@ jobs:
--cmake_extra_defines CMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Generate ONNX protobuf files
run: cmake --build build/Debug --config Debug --target onnx_proto
# - name: Run clang-tidy
# uses: ZedThree/clang-tidy-review@526cbfb043719639f1ebdeedae0cc1eacd219d8f
# with:
# token: ${{ secrets.github_token }}
# build_dir: "build/Debug"
# config_file: ".clang-tidy"
# lgtm_comment_body: ""
- uses: reviewdog/action-cpplint@master
with:
github_token: ${{ secrets.github_token }}
Expand All @@ -117,7 +95,7 @@ jobs:
name: Lint JavaScript
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: reviewdog/action-eslint@v1
with:
reporter: github-pr-check
Expand Down
42 changes: 23 additions & 19 deletions .github/workflows/publish-c-apidocs.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
name: Update C/C++ API Docs

# Run when the C API changes or every month so that the artifact does not expire
on:
push:
branches:
- main
paths:
- include/onnxruntime/core/session

schedule:
- cron: '0 0 1 * *'
workflow_dispatch:

concurrency:
group: "apidocs-c"
cancel-in-progress: false

permissions:
contents: write

jobs:
publish:
build:
name: Generate C/C++ API docs
runs-on: ubuntu-latest
steps:
Expand All @@ -21,27 +31,21 @@ jobs:
sudo apt-get install libclang-cpp14
wget https://www.doxygen.nl/files/doxygen-1.9.6.linux.bin.tar.gz
tar xvzf doxygen-1.9.6.linux.bin.tar.gz
- name: Set commit ID
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Run doxygen
run: |
mkdir -p build/doxygen
cd docs/c_cxx
../../doxygen-1.9.6/bin/doxygen
- uses: actions/checkout@v2
with:
ref: gh-pages
clean: false
- name: Move API docs into target area
- name: Log source commit
run: git rev-parse --short HEAD > build/doxygen/html/source-version.txt
- name: Move C/C++ docs into site
run: |
rm -rf docs/api/c
mv build/doxygen/html docs/api/c
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
mkdir -p _site/docs/api
rm -rf site/docs/api/c
mv build/doxygen/html _site/docs/api/c
- name: Upload new site
uses: actions/upload-artifact@v3
with:
branch: gh-pages-pr-c-docs
base: gh-pages
title: '[Automated]: Update C/C++ API docs'
commit-message: 'Update C/C++ API docs to commit ${{ steps.vars.outputs.sha_short }}'
add-paths: docs/api/c
name: onnxruntime-c-apidocs
path: _site
retention-days: 60
65 changes: 34 additions & 31 deletions .github/workflows/publish-csharp-apidocs.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
name: Update C# API Docs

# Run when the C# API changes or every month so that the artifact does not expire
on:
push:
branches:
- main
paths:
- csharp
schedule:
- cron: '0 0 1 * *'
workflow_dispatch:

concurrency:
group: "apidocs-csharp"
cancel-in-progress: false

permissions:
contents: write

jobs:
publish:
runs-on: windows-latest
build:
runs-on: ubuntu-latest
env:
DOCFXVERSION: 2.62.2
steps:
- uses: actions/checkout@v3
- name: Setup .NET
Expand All @@ -17,39 +34,25 @@ jobs:
- name: Download DocFX
run: |
mkdir -p build/docfx
Invoke-WebRequest -Uri "https://github.com/dotnet/docfx/releases/download/v${env:DOCFXVERSION}/docfx.zip" -OutFile "build/docfx/docfx.zip"
[System.IO.Compression.ZipFile]::ExtractToDirectory("build/docfx/docfx.zip", "build/docfx" )
cd build/docfx
ls
env:
DOCFXVERSION: 2.59.3
wget https://github.com/dotnet/docfx/releases/download/v${DOCFXVERSION}/docfx-linux-x64-v${DOCFXVERSION}.zip -O build/docfx/docfx.zip
unzip build/docfx/docfx.zip -d build/docfx
- name: Install NuGet
uses: nuget/setup-nuget@v1
- name: Build Documentation
run: |
ls
build/docfx/docfx.exe metadata csharp/ApiDocs/docfx.json
build/docfx/docfx metadata csharp/ApiDocs/docfx.json
dotnet build csharp/ApiDocs/ApiDocs.csproj --no-restore
build/docfx/docfx.exe build csharp/ApiDocs/docfx.json
- name: Set commit ID
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- uses: actions/checkout@v2
with:
ref: gh-pages
clean: false
- name: Move API docs into target area
build/docfx/docfx build csharp/ApiDocs/docfx.json
- name: Log source commit
run: git rev-parse --short HEAD > csharp/ApiDocs/csharp/source-version.txt
- name: Move C# docs into site
run: |
if (Test-Path -Path docs/api/csharp) {rm -r -fo docs/api/csharp}
MOVE csharp/ApiDocs/csharp docs/api
rm -r -fo csharp/ApiDocs
rm -r -fo csharp/src
- name: Git Checkin
run: git add .
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
mkdir -p _site/docs/api
rm -rf _site/docs/api/csharp
mv csharp/ApiDocs/csharp _site/docs/api/csharp
- name: Upload docs artifact
uses: actions/upload-artifact@v3
with:
branch: gh-pages-pr-csharp-docs
base: gh-pages
title: '[Automated]: Update C# API docs'
commit-message: 'Update C# API docs to commit ${{ steps.vars.outputs.sha_short }}'
name: onnxruntime-csharp-apidocs
path: _site
retention-days: 60
Loading

0 comments on commit 024d69d

Please sign in to comment.