-
Notifications
You must be signed in to change notification settings - Fork 2
112 lines (109 loc) · 3.9 KB
/
affected.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
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
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
on:
workflow_call:
inputs:
config-file:
description: Path to the custard config file.
type: string
required: true
head-sha:
description: The commit sha of the head where the changes live.
type: string
required: true
main-sha:
description: The commit sha of the main branch to be compared to.
default: origin/main
type: string
paths:
description: Comma-separated package paths instead of git diff.
type: string
custard-version:
description: Custard version to install.
type: string
default: v0.2.1
go-version:
description: Go version to build the custard tools.
type: string
default: ^1.22.0
create-check-if:
description: Creates a check if true, otherwise no check is created.
type: boolean
default: true
check-name:
description: Name of the check created by this workflow.
type: string
default: Custard CI
timeout-minutes:
description: Timeout to find affected packages.
type: number
default: 2
outputs:
paths:
description: The affected paths as a JSON list.
value: ${{ jobs.affected.outputs.paths }}
num-paths:
description: The number of affected paths.
value: ${{ jobs.affected.outputs.num-paths }}
ci-setups:
description: The CI setup configurations for the affected packages.
value: ${{ jobs.affected.outputs.ci-setups }}
check:
description: The check that was created by this job.
value: ${{ jobs.affected.outputs.check }}
jobs:
affected:
runs-on: ubuntu-latest
permissions:
statuses: write
outputs:
paths: ${{ steps.custard.outputs.paths }}
num-paths: ${{ steps.custard.outputs.num-paths }}
ci-setups: ${{ steps.custard.outputs.ci-setups }}
check: ${{ steps.in_progress.outputs.check }}
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- name: Check queued
uses: GoogleCloudPlatform/cloud-samples-tools/actions/steps/[email protected]
id: queued
with:
sha: ${{ inputs.head-sha }}
name: ${{ inputs.check-name }}
status: queued
title: Finding affected packages
job-name: ${{ github.job }}
if: ${{ inputs.create-check-if }}
- name: Find affected packages
uses: GoogleCloudPlatform/cloud-samples-tools/actions/steps/[email protected]
id: custard
with:
config-file: ${{ inputs.config-file }}
head-sha: ${{ inputs.head-sha }}
main-sha: ${{ inputs.main-sha }}
paths: ${{ inputs.paths }}
custard-version: ${{ inputs.custard-version }}
go-version: ${{ inputs.go-version }}
- name: Check in_progress
uses: GoogleCloudPlatform/cloud-samples-tools/actions/steps/[email protected]
id: in_progress
with:
check: ${{ steps.queued.outputs.check }}
status: in_progress
title: Running ${{ steps.custard.outputs.num-paths }} package(s)
- name: Check failure
uses: GoogleCloudPlatform/cloud-samples-tools/actions/steps/[email protected]
if: failure()
with:
check: ${{ steps.queued.outputs.check }}
status: failure