microsoft/typespec

Public

mirrored from https://github.com/microsoft/typespecAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
copilot/fix-7367

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

.github/workflows/consistency.yml

105lines · modecode

1name: Consistency
2
3# Controls when the workflow will run
4on:
5 # Triggers the workflow on push or pull request events but only for the "main" branch
6 push:
7 branches: ["main"]
8 pull_request:
9 branches: ["main"]
10 merge_group:
11 workflow_dispatch: {}
12
13# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14jobs:
15 check-changes:
16 name: Check Changes
17 runs-on: ubuntu-latest
18 if: |
19 github.event_name == 'pull_request' &&
20 !startsWith(github.head_ref, 'publish/') &&
21 !startsWith(github.head_ref, 'dependabot/') &&
22 !startsWith(github.head_ref, 'backmerge/') &&
23 !startsWith(github.head_ref, 'revert-')
24 steps:
25 - uses: actions/checkout@v4
26 with:
27 fetch-depth: 0 ## Needed for Changesets to find `main` branch
28 submodules: recursive
29
30 - uses: ./.github/actions/setup
31
32 - run: git fetch --force --no-tags origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }}
33 name: Get ${{ github.event.pull_request.base.ref }} ref for ${{ github.ref}}, evt ${{ github.event_name }}
34
35 - run: pnpm install
36 name: Install dependencies
37
38 - name: Create PR Comment
39 run: pnpm chronus-github get-pr-comment --out ./comment-out/comment.json
40 env:
41 GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
42
43 - uses: actions/upload-artifact@v4
44 with:
45 name: comment
46 path: comment-out/
47 retention-days: 1 # Only need for the next workflow so don't need to waste storageretention-days
48
49 - run: pnpm chronus verify --since ${{ github.event.pull_request.base.ref }}
50 name: Check changelog
51
52 # Validate spell check
53 spellcheck:
54 name: Spell check
55 runs-on: ubuntu-latest
56 steps:
57 - uses: actions/checkout@v4
58 with:
59 submodules: recursive
60 - uses: ./.github/actions/setup
61
62 - run: pnpm install
63 name: Install dependencies
64
65 - run: pnpm run cspell
66 name: Spell check
67
68 # Validate formatting
69 format:
70 name: Format
71 runs-on: ubuntu-latest
72 steps:
73 - uses: actions/checkout@v4
74 with:
75 submodules: recursive
76 - uses: ./.github/actions/setup
77
78 - run: pnpm install
79 name: Install dependencies
80
81 - run: pnpm --filter="@typespec/prettier-plugin-typespec..." run build
82 name: Build prettier plugin
83
84 - run: pnpm run format:check
85 name: Check formatting
86
87 # Lint
88 lint:
89 name: Lint
90 runs-on: ubuntu-latest
91 steps:
92 - uses: actions/checkout@v4
93 with:
94 submodules: recursive
95
96 - uses: ./.github/actions/setup
97
98 - run: pnpm install
99 name: Install dependencies
100
101 - run: pnpm --filter="@typespec/eslint-plugin..." run build
102 name: Build prettier plugin
103
104 - run: pnpm run lint
105 name: Lint
106