From 67ec34b3277df272363b7c5faac287ceedfc489a Mon Sep 17 00:00:00 2001 From: root <23239305+b-chu@users.noreply.github.com> Date: Fri, 19 Jan 2024 20:21:39 +0000 Subject: [PATCH] Uses Composer's code quality workflow Uses Composer's reusuable code quality workflow for consistency. --- .github/workflows/code-quality.yaml | 43 -------------------------- .github/workflows/pr-code-quality.yaml | 27 ++++++++++++++++ 2 files changed, 27 insertions(+), 43 deletions(-) delete mode 100644 .github/workflows/code-quality.yaml create mode 100644 .github/workflows/pr-code-quality.yaml diff --git a/.github/workflows/code-quality.yaml b/.github/workflows/code-quality.yaml deleted file mode 100644 index 77f1b55e0e..0000000000 --- a/.github/workflows/code-quality.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: Code Quality Checks -on: - push: - branches: - - main - - release/** - pull_request: - branches: - - main - - release/** - workflow_call: - workflow_dispatch: -# Cancel old runs when a new commit is pushed to the same branch if not on main or dev -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} -defaults: - run: - working-directory: . -jobs: - code-quality: - runs-on: ubuntu-20.04 - timeout-minutes: 20 - strategy: - matrix: - python_version: - - '3.9' - - '3.10' - pip_deps: - - '[dev]' - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python_version }} - - name: Setup - run: | - set -ex - python -m pip install --upgrade 'pip<23' wheel - python -m pip install --upgrade .${{ matrix.pip_deps }} - - name: Run checks - run: | - pre-commit run --all-files diff --git a/.github/workflows/pr-code-quality.yaml b/.github/workflows/pr-code-quality.yaml new file mode 100644 index 0000000000..f69c1ad4a3 --- /dev/null +++ b/.github/workflows/pr-code-quality.yaml @@ -0,0 +1,27 @@ +name: PR Code Quality Checks +on: + push: + branches: + - main + - release/** + pull_request: + - main + - release/** + workflow_dispatch: +# Cancel old runs when a new commit is pushed to the same branch if not on main or dev +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} +jobs: + code-quality: + uses: mosaicml/composer/.github/workflows/code-quality.yaml@v0.18.1 + strategy: + matrix: + python_version: + - '3.9' + - '3.10' + pip_deps: + - '[dev]' + with: + python_version: ${{ matrix.python_version }} + pip_deps: ${{ matrix.pip_deps }}