Skip to content

Use reusable actions for linting #748

Use reusable actions for linting

Use reusable actions for linting #748

name: PR Code Quality Checks
on:
push:
branches:
- dev
- main
- release/**
pull_request:
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' && github.ref != 'refs/heads/dev' }}
jobs:
code-quality:
runs-on: ubuntu-20.04
timeout-minutes: 15
strategy:
matrix:
python_version:
- "3.9"
- "3.10"
- "3.11"
pip_deps:
- "[dev]"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get Repo Token
id: REPO_TOKEN
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.DEVOGE_BOT_PUB_APPID }}
private_key: ${{ secrets.DEVOGE_BOT_PUB_PEM }}
- name: Get composite run steps repository
uses: actions/checkout@v3
with:
repository: mosaicml/testing
ref: cicd
path: ./testing
token: ${{ steps.REPO_TOKEN.outputs.token }}
- name: Run checks
shell: bash
run: |
ls .
ls ./testing
ls ./testing/.github
ls ./testing/.github/actions
ls ./testing/.github/actions/code-quality
- uses: ./testing/.github/actions/code-quality
with:
python_version: ${{ matrix.python_version }}
pip_deps: ${{ matrix.pip_deps }}