Repository navigation
94 lines (90 loc) · 3.23 KB
/
Copy pathgenerated_files_sync.yaml
File metadata and controls
94 lines (90 loc) · 3.23 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
# Copyright 2022 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.
# Github action job to test core java library features on
# downstream client libraries before they are released.
on:
push:
branches:
- main
pull_request:
name: generation diff
jobs:
root-pom:
# root pom.xml does not have diff from generated one
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Generate root pom.xml file
run: |
bash generation/generate_root_pom.sh
- name: Apply versions from versions.txt files
run: |
bash generation/apply_current_versions.sh
- name: Fail if there's any difference
run: git --no-pager diff --exit-code
gapic-bom:
# gapic-libraries-bom does not have diff from generated one
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Generate gapic-libraries-bom/pom.xml
run: |
bash generation/generate_gapic_bom.sh
- name: Apply versions from versions.txt files
run: |
bash generation/apply_current_versions.sh
- name: Fail if there's any difference
run: git --no-pager diff --exit-code
owlbot-py:
# applying templated owlbot.py config doesn't create a diff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Generate owlbot.py files
run: |
bash generation/update_owlbot_postprocessor_config.sh
- name: Fail if there's any difference
run: git --no-pager diff --exit-code
gitignore_correctness:
# Generated files should not match .gitignore
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: checking any files matching gitignore
# By default, GitHub Actions's bash has '-e' option to fail immediately
# upon non-zero exit code. Not using it here to catch the exit code 1.
shell: /usr/bin/bash --noprofile --norc -o pipefail {0}
run: |
find . -type f -name '*.java' -not -path './.git/*' \
|git check-ignore --no-index --verbose --stdin
# https://git-scm.com/docs/git-check-ignore returns 1 when there's no
# matching files with the gitignore file.
# "--no-index" is needed to check against tracked files.
if [ "$?" == 1 ]; then
echo "No matching files. Good."
exit 0
else
echo "There are gitignore matching files. Please adjust .gitignore."
exit 1
fi
consolidate-config:
# Parent handles config for child modules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Apply consolidate_config.sh
run: |
bash generation/consolidate_config.sh
- name: Fail if there's any difference
run: git --no-pager diff --exit-code