-
Notifications
You must be signed in to change notification settings - Fork 1.1k
156 lines (145 loc) 路 4.73 KB
/
on-pr.yml
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Pull Request
permissions:
# To create a draft release.
contents: write
# To comment on PRs.
pull-requests: write
# To sign artifacts.
id-token: write
on:
pull_request:
paths-ignore:
- "sdk/.version"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# The jobs in this workflow are only run on branches. The `on-community-pr.yml` job provides
# commands for running workflows from forks.
jobs:
changelog-comment:
name: changelog preview
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
permissions:
contents: read
pull-requests: write
uses: ./.github/workflows/on-pr-changelog.yml
with:
ref: ${{ github.ref }}
base-ref: origin/${{ github.base_ref }}
pr-number: ${{ github.event.pull_request.number }}
changelog-required: ${{ !contains(github.event.pull_request.labels.*.name, 'impact/no-changelog-required') }}
secrets: inherit
info:
name: info
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
uses: ./.github/workflows/ci-info.yml
permissions:
contents: read
with:
ref: ${{ github.ref }}
is-snapshot: true
secrets: inherit
# Determines which files have changed so we can avoid running expensive tests
# if they're not necessary.
inspect:
name: Inspect changed files
runs-on: ubuntu-latest
steps:
- uses: dorny/paths-filter@v3
id: changes
with:
token: ${{ secrets.PULUMI_BOT_TOKEN }}
filters: |
# If files matching any of these patterns change,
# we will run codegen tests for pull requests.
test-codegen:
- 'pkg/codegen/docs/**'
- 'pkg/codegen/dotnet/**'
- 'pkg/codegen/go/**'
- 'pkg/codegen/nodejs/**'
- 'pkg/codegen/python/**'
outputs:
# Add an entry here for every named pattern
# defined in filters.
test-codegen: ${{ steps.changes.outputs.test-codegen }}
ci:
name: CI
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
needs: [info, inspect]
uses: ./.github/workflows/ci.yml
permissions:
contents: read
# To sign artifacts.
id-token: write
with:
ref: ${{ github.ref }}
version: ${{ needs.info.outputs.version }}
lint: true
build-all-targets: ${{ contains(github.event.pull_request.labels.*.name, 'ci/test') }}
# codegen tests take quite a while to run.
# Run them only if ci/test is set,
# or if one of the codegen files changed.
test-codegen: >- # No newlines or trailing newline.
${{
contains(github.event.pull_request.labels.*.name, 'ci/test') ||
(needs.inspect.outputs.test-codegen == 'true')
}}
test-version-sets: >- # No newlines or trailing newline.
${{
contains(github.event.pull_request.labels.*.name, 'ci/test')
&& 'minimum current'
|| 'current'
}}
integration-test-platforms: ubuntu-latest
acceptance-test-platforms: >- # No newlines or trailing newline.
${{
contains(github.event.pull_request.labels.*.name, 'ci/test')
&& 'macos-latest windows-latest'
|| ''
}}
# We'll only upload coverage artifacts with the periodic-coverage cron workflow.
enable-coverage: false
secrets: inherit
prepare-release:
name: prepare
if: >- # No newlines or trailing newline.
${{
github.event.pull_request.head.repo.full_name == github.repository
&& contains(github.event.pull_request.labels.*.name, 'ci/test')
}}
needs: [info, ci]
uses: ./.github/workflows/ci-prepare-release.yml
permissions:
contents: write
# To sign artifacts.
id-token: write
with:
ref: ${{ github.ref }}
version: ${{ needs.info.outputs.version }}
release-notes: ${{ needs.info.outputs.release-notes }}
project: ${{ github.repository }}
draft: true
prerelease: true
secrets: inherit
ci-ok:
name: ci-ok
needs: [ci]
runs-on: ubuntu-latest
steps:
- name: CI succeeded
run: exit 0
# release:
# name: release
# if: ${{ contains(github.event.pull_request.labels.*.name, 'ci/test') }}
# needs: [info, matrix, prepare-release]
# uses: ./.github/workflows/release.yml
# permissions:
# contents: write
# pull-requests: write
# with:
# ref: ${{ github.ref }}
# version: ${{ needs.info.outputs.version }}
# release-notes: ${{ needs.info.outputs.release-notes }}
# version-set: ${{ needs.matrix.outputs.version-set }}
# queue-merge: false
# secrets: inherit