forked from Azure/azure-rest-api-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (70 loc) · 2.47 KB
/
typespec-validation-all.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: TypeSpec Validation - All
on:
push:
branches:
- main
- RPSaaSMaster
- typespec-next
pull_request:
branches:
- main
- RPSaaSMaster
- typespec-next
paths:
- .gitattributes
- .prettierrc.json
- package-lock.json
- package.json
- tsconfig.json
- eng/**
- specification/suppressions.yaml
- specification/common-types/**
# Workflow and workflow dependencies
- .github/workflows/typespec-validation-all.yaml
- .github/actions/setup-node-npm-ci/**
schedule:
# Run 4x/day
- cron: '0 0,6,12,18 * * *'
workflow_dispatch:
jobs:
typespec-validation-all:
# Use short name to maximize space for parameters in UI
name: TSV
strategy:
# Validate all specs, even if one job fails early
fail-fast: false
# Sort matrix elements from "most important" to "least important" for the best grouping and UI
# Keep matrix values short, to maximize number of parameters shown in UI
matrix:
# When triggered by schedule, validate both the default branch and typespec-next
# Use the placeholder string "default" instead of passing "" directly, since the latter gets ignored by
# the GitHub Jobs UI.
ref: ${{ fromJSON(github.event_name == 'schedule' && '["default", "next"]' || '["default"]') }}
os: [ubuntu, windows]
# shards must start at 0 and increment by 1
shard: [0, 1, 2]
# total-shards must be an accurate count of the number of shards
total-shards: [3]
runs-on: ${{ matrix.os }}-latest
steps:
- name: Enable git long paths
if: runner.os == 'Windows'
run: git config --global core.longpaths true
- uses: actions/checkout@v4
with:
# Convert placeholder string 'default' to '', which tells the action to checkout the default ref.
ref: ${{ matrix.ref == 'next' && 'typespec-next' || '' }}
- name: Setup Node and run `npm ci`
uses: ./.github/actions/setup-node-npm-ci
- name: Validate All Specs
run: |
# Keep processing when errors are written. Nonzero exit will mark the
# step as failed.
$ErrorActionPreference = 'Continue'
./eng/scripts/TypeSpec-Validation.ps1 `
-Shard ${{ matrix.shard }} `
-TotalShards ${{ matrix.total-shards }} `
-CheckAll `
-GitClean `
-Verbose
shell: pwsh