Skip to content

Commit

Permalink
move code checks to workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
iscai-msft committed May 6, 2024
1 parent 1af79ab commit 18a813d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 12 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/consistency.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Consistency

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: ["main"]
pull_request:
branches: ["main"]
merge_group:
workflow_dispatch: {}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
check-changes:
name: Check Changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 ## Needed for Changesets to find `main` branch
submodules: recursive

- name: Install pnpm
uses: pnpm/action-setup@v2

- run: git pull --force --no-tags origin main:main
name: Get main ref

- run: pnpm install
name: Install dependencies

- run: pnpm change verify
name: Check changelog
if: ${{ !startsWith(github.head_ref, 'publish/') && !startsWith(github.head_ref, 'dependabot/') && !startsWith(github.head_ref, 'backmerge/') }}

- run: pnpm check-version-mismatch
name: Check version mismatch

- run: pnpm lint
name: Lint project

- run: pnpm check-format
name: Check formatting
12 changes: 0 additions & 12 deletions eng/pipelines/ci-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,6 @@ steps:
displayName: Build project
workingDirectory: $(Build.SourcesDirectory)/autorest.python/

- script: pnpm check-version-mismatch
displayName: Check version mismatch
workingDirectory: $(Build.SourcesDirectory)/autorest.python/

- script: pnpm lint
displayName: Lint project
workingDirectory: $(Build.SourcesDirectory)/autorest.python/

- script: pnpm check-format
displayName: Check formatting
workingDirectory: $(Build.SourcesDirectory)/autorest.python/

- script: pip install -r dev_requirements.txt
displayName: Pip install dev requirements
workingDirectory: $(Build.SourcesDirectory)/autorest.python/packages/${{parameters.folderName}}
Expand Down

0 comments on commit 18a813d

Please sign in to comment.