-
Notifications
You must be signed in to change notification settings - Fork 371
115 lines (90 loc) · 3.31 KB
/
external-integration.yml
File metadata and controls
115 lines (90 loc) · 3.31 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Integration
on:
pull_request:
branches: ["main"]
paths-ignore:
- "packages/http-client-csharp/**"
- "packages/http-client-java/**"
- "packages/http-client-python/**"
- "website/**"
- "docs/**"
# Allow manual triggering
workflow_dispatch:
permissions:
contents: read
# This check is optional by default
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
azure-integration-check:
name: Azure/typespec-azure
runs-on: ubuntu-latest
# Only run if not from dependabot, publish, backmerge, or revert branches
if: |
!startsWith(github.head_ref, 'dependabot/') &&
!startsWith(github.head_ref, 'publish/') &&
!startsWith(github.head_ref, 'backmerge/') &&
!startsWith(github.head_ref, 'revert-')
steps:
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: lts/*
- name: Checkout Azure/typespec-azure repo
uses: actions/checkout@v6
with:
repository: Azure/typespec-azure
submodules: true
- name: Install pnpm
uses: pnpm/action-setup@v6
- name: Update core submodule to PR commit
run: |
# Configure git to use the PR's repository as a remote for the submodule
cd core
git remote add pr https://github.com/${{ github.repository }}.git
git fetch pr ${{ github.event.pull_request.head.sha }}
# Update the submodule to point to the PR commit
git checkout ${{ github.event.pull_request.head.sha }}
- name: Install
run: pnpm install --no-frozen-lockfile
- name: Install Playwright
run: pnpm exec playwright install
- name: Build
run: pnpm build
- name: Test
run: pnpm test
- name: E2E Test
run: pnpm test:e2e
azure-rest-api-specs:
name: Azure REST API Specs
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'int:azure-specs') || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: true
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Setup Node.js and pnpm
uses: ./.github/actions/setup
- name: Install dependencies
run: pnpm install
- name: Build and pack TypeSpec Azure packages
run: |
pnpm --filter "!@typespec/playground-website" --filter "!@typespec/website" -r build
pnpm chronus pack --pack-destination ./tgz-packages --exclude standalone
echo "Created tgz packages:"
ls -la ./tgz-packages/
cd packages/tsp-integration
npm link
- name: Checkout
run: tsp-integration azure-specs --stage checkout
- name: Patch package.json
run: tsp-integration azure-specs --stage patch --stage install --tgz-dir ./tgz-packages
- name: Run TypeSpec validation in azure-rest-api-specs
run: tsp-integration azure-specs --stage validate
- name: Check for git changes
if: success() || failure() # Still run this step even if validation fails to ensure as much information as possible
run: tsp-integration azure-specs --stage validate:clean