This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
chore: Bring back release-please.yml #2920
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
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
name: ci | |
jobs: | |
clirr: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 8 | |
- run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV | |
- run: .kokoro/build.sh | |
env: | |
JOB_TYPE: clirr | |
units-java11: | |
name: "units (11)" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 11 | |
distribution: zulu | |
- run: java -version | |
- run: .kokoro/build.sh | |
env: | |
JOB_TYPE: test | |
units-java8: | |
name: "units (8)" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# Java 8 tests uses JDK 11 to compile and JDK 8 to run tests. See .kokoro/ | |
# build.sh for the setup. | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 8 | |
distribution: zulu | |
- run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 11 | |
distribution: zulu | |
- run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV | |
- run: printenv | |
- run: .kokoro/build.sh | |
env: | |
JOB_TYPE: test | |
bazel: | |
runs-on: ubuntu-latest | |
# Not using a container. The ubuntu-latest has Bazel 4.2 installed as of | |
# November 2021. gRPC 1.42 requires Bazel 4. | |
# https://github.com/grpc/grpc-java/pull/7598 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: 8 | |
- run: java -version | |
- name: Bazel File Cache Setup | |
id: cache-bazel | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/bazel | |
key: ${{ runner.os }}-bazel-20210105-${{ secrets.CACHE_VERSION }} | |
- name: Bazel Cache Not Found | |
if: steps.cache-bazel.outputs.cache-hit != 'true' | |
run: | | |
echo "No cache found." | |
- name: Bazel Cache Found | |
if: steps.cache-bazel.outputs.cache-hit == 'true' | |
run: | | |
echo -n "Cache found. Cache size: " | |
du -sh ~/.cache/bazel | |
echo "If the cache seems broken, update the CACHE_VERSION secret in" | |
echo "https://github.com/googleapis/googleapis-discovery/settings/secrets/actions" | |
echo "(use any random string, any GUID will work)" | |
echo "and it will start over with a clean cache." | |
echo "The old one will disappear after 7 days." | |
- name: Run bazel tests | |
run: | | |
which bazel | |
bazel --version | |
bazel --batch test //... --noshow_progress --test_output=errors | |
- uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: test-artifacts | |
path: ~/.cache/bazel/*/*/*/gax-java/bazel-out/*/testlogs/* | |
retention-days: 5 | |
requirements: | |
name: "requirements" | |
runs-on: ubuntu-latest | |
container: gcr.io/cloud-devrel-public-resources/java8 | |
steps: | |
- uses: actions/checkout@v2 | |
- run: | | |
python3 --version | |
python3 -m pip install --require-hashes -r .kokoro/requirements.txt |