Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add changelog check #2530

Merged
merged 20 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 1 addition & 2 deletions .github/workflows/prepare-auto-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
pull-requests: write
contents: write

jobs:
Expand All @@ -34,4 +33,4 @@ jobs:
- name: Create release branch
run: node ./eng/publish.mjs
env:
GITHUB_TOKEN: ${{secrets.CUSTOM_GITHUB_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 6 additions & 12 deletions eng/pipelines/ci-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ steps:
workingDirectory: $(Build.SourcesDirectory)/autorest.python/
condition: and(succeeded(), eq(${{ parameters.updateToLatestTypespec }}, false))

- script: pnpm change verify
displayName: Check changelog
workingDirectory: $(Build.SourcesDirectory)/autorest.python/
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/heads/publish/')), not(startsWith(variables['Build.SourceBranch'], 'refs/heads/dependabot/')))
continueOnError: true

- script: pnpm list
displayName: Pnpm list
workingDirectory: $(Build.SourcesDirectory)/autorest.python/packages/typespec-python
Expand All @@ -63,18 +69,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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"workspaces": [
"packages/*"
],
"packageManager": "pnpm@8.13.1",
"scripts": {
"preinstall": "npx only-allow pnpm",
"watch": "tsc --build ./tsconfig.ws.json --watch",
Expand Down
Loading