-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update hermetic library generation workflow (#10693)
* chore: update generation workflow * update workflow * update new client creation workflow * add base branch * use shell script * generalize repo name * add script to update googleapis commit * update comments * update workflow file * update image tag * try to fix workflow error * change comment * update comment * refactor according to code review * restore change * update branch
- Loading branch information
1 parent
61aa5c2
commit 91fa7be
Showing
7 changed files
with
273 additions
and
175 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,42 @@ | ||
# Copyright 2024 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. | ||
name: Hermetic library generation upon generation config change through pull requests | ||
on: | ||
pull_request: | ||
types: | ||
- synchronize | ||
paths: | ||
- generation_config.yaml | ||
- "generation_config.yaml" | ||
|
||
jobs: | ||
library_generation: | ||
runs-on: ubuntu-latest | ||
env: | ||
library_generation_image_tag: latest | ||
repo_volumes: "-v repo-google-cloud-java:/workspace/google-cloud-java" | ||
library_generation_image_tag: 2.39.0 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
- name: get baseline generation config | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.base_ref }} | ||
path: baseline | ||
sparse-checkout: generation_config.yaml | ||
- name: diff | ||
fetch-depth: 0 | ||
- name: Generate changed libraries | ||
shell: bash | ||
run: | | ||
diff generation_config.yaml baseline/generation_config.yaml | ||
set -x | ||
[ -z "$(git config user.email)" ] && git config --global user.email "[email protected]" | ||
[ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot" | ||
bash generation/hermetic_library_generation.sh \ | ||
--target_branch ${{ github.base_ref }} \ | ||
--current_branch ${{ github.head_ref }} \ | ||
--image_tag "${library_generation_image_tag}" | ||
env: | ||
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright 2024 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. | ||
name: Update googleapis commit | ||
on: | ||
schedule: | ||
- cron: '* 2 * * *' | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
update-googleapis-commit: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
# the branch into which the pull request is merged | ||
base_branch: main | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Update googleapis commit to latest | ||
shell: bash | ||
run: | | ||
set -x | ||
[ -z "$(git config user.email)" ] && git config --global user.email "[email protected]" | ||
[ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot" | ||
bash generation/update_googleapis_commit.sh \ | ||
--base_branch "${base_branch}"\ | ||
--repo ${{ github.repository }} | ||
env: | ||
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} |
Oops, something went wrong.