mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
Move suggest fixes to a separate CI workflow (#22415)
Move suggest fixes to a separate CI workflow so that it is triggered only on PRs and does not fail the main branch.
This commit is contained in:
parent
04404ea482
commit
9b1b4e54bb
2 changed files with 53 additions and 32 deletions
36
.github/workflows/lint.yml
vendored
36
.github/workflows/lint.yml
vendored
|
|
@ -7,6 +7,10 @@ on:
|
|||
- rel-*
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'workflow_dispatch' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
optional-lint:
|
||||
name: Optional Lint
|
||||
|
|
@ -72,38 +76,6 @@ jobs:
|
|||
category: lintrunner
|
||||
checkout_path: ${{ github.workspace }}
|
||||
|
||||
auto-apply-fixes:
|
||||
name: Suggest fixes
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
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"
|
||||
- name: Setup Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
components: rustfmt
|
||||
- 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
|
||||
lintrunner f --all-files -v
|
||||
exit 0
|
||||
- uses: parkerbxyz/suggest-changes@v1
|
||||
with:
|
||||
comment: 'You can commit the suggested changes from lintrunner.'
|
||||
|
||||
lint-cpp:
|
||||
name: Optional Lint C++
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
49
.github/workflows/pr_checks.yml
vendored
Normal file
49
.github/workflows/pr_checks.yml
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
# Copyright (c) ONNX Project Contributors
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
name: PR Checks
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions: # set top-level default permissions as security best practice
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'workflow_dispatch' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
auto-apply-fixes:
|
||||
name: Suggest fixes
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.10"
|
||||
- name: Setup Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
components: rustfmt
|
||||
- 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
|
||||
lintrunner f --all-files -v
|
||||
exit 0
|
||||
- uses: parkerbxyz/suggest-changes@v1
|
||||
with:
|
||||
comment: 'You can commit the suggested changes from lintrunner.'
|
||||
Loading…
Reference in a new issue