Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: configure the protected branch #1870

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
107 changes: 52 additions & 55 deletions .github/workflows/ci-java7.yaml
Original file line number Diff line number Diff line change
@@ -1,62 +1,59 @@
# 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:
'on':
push:
branches:
- main
pull_request:
- 1.43.x
pull_request: null
name: ci-java7
jobs:
units:
name: "units (7)"
name: units (7)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
# setup-java v2 or higher does not have version 1.7
with:
version: 1.7
architecture: x64
- run: |
java -version
# This value is used in "-Djvm=" later
echo "JAVA7_HOME=${JAVA_HOME}" >> $GITHUB_ENV
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.8.8
- name: Build
shell: bash
run: |
# Leveraging surefire's jvm option, running the test on Java 7.
# Surefire plugin 2.22.2 is the last version for Java 7. Newer version would fail with
# "UnsupportedClassVersionError: org/apache/maven/surefire/booter/ForkedBooter" error.

# Why are these modules are skipped?
# google-http-client-jackson2 and google-http-client-appengine do not work with Java 7
# any more because of Jackson and appengine library are compiled for Java 8.
# dailymotion-simple-cmdline-sample and google-http-client-assembly depend on
# google-http-client-jackson2
mvn --batch-mode --show-version -ntp test \
--projects '!google-http-client-jackson2,!google-http-client-appengine,!samples/dailymotion-simple-cmdline-sample,!google-http-client-assembly' \
-Dclirr.skip=true -Denforcer.skip=true -Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true -T 1C \
-Dproject.surefire.version=2.22.2 \
-Djvm=${JAVA7_HOME}/bin/java
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
with:
version: 1.7
architecture: x64
- run: |
java -version
# This value is used in "-Djvm=" later
echo "JAVA7_HOME=${JAVA_HOME}" >> $GITHUB_ENV
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.8.8
- name: Build
shell: bash
run: >
# Leveraging surefire's jvm option, running the test on Java 7.

# Surefire plugin 2.22.2 is the last version for Java 7. Newer version
would fail with

# "UnsupportedClassVersionError:
org/apache/maven/surefire/booter/ForkedBooter" error.


# Why are these modules are skipped?

# google-http-client-jackson2 and google-http-client-appengine do not
work with Java 7

# any more because of Jackson and appengine library are compiled for
Java 8.

# dailymotion-simple-cmdline-sample and google-http-client-assembly
depend on

# google-http-client-jackson2

mvn --batch-mode --show-version -ntp test \
--projects '!google-http-client-jackson2,!google-http-client-appengine,!samples/dailymotion-simple-cmdline-sample,!google-http-client-assembly' \
-Dclirr.skip=true -Denforcer.skip=true -Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true -T 1C \
-Dproject.surefire.version=2.22.2 \
-Djvm=${JAVA7_HOME}/bin/java
121 changes: 56 additions & 65 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,89 +1,80 @@
# 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:
'on':
push:
branches:
- main
pull_request:
- 1.43.x
pull_request: null
name: ci
jobs:
units:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [8, 11, 17]
java:
- 8
- 11
- 17
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: ${{matrix.java}}
- run: java -version
- run: .kokoro/build.sh
env:
JOB_TYPE: test
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: ${{matrix.java}}
- run: java -version
- run: .kokoro/build.sh
env:
JOB_TYPE: test
windows:
runs-on: windows-latest
steps:
- name: Support longpaths
run: git config --system core.longpaths true
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 8
- run: java -version
- run: .kokoro/build.bat
env:
JOB_TYPE: test
- name: Support longpaths
run: git config --system core.longpaths true
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 8
- run: java -version
- run: .kokoro/build.bat
env:
JOB_TYPE: test
dependencies:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11, 17]
java:
- 8
- 11
- 17
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: ${{matrix.java}}
- run: java -version
- run: .kokoro/dependencies.sh
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: ${{matrix.java}}
- run: java -version
- run: .kokoro/dependencies.sh
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
- run: java -version
- run: .kokoro/build.sh
env:
JOB_TYPE: lint
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
- run: java -version
- run: .kokoro/build.sh
env:
JOB_TYPE: lint
clirr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 8
- run: java -version
- run: .kokoro/build.sh
env:
JOB_TYPE: clirr
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 8
- run: java -version
- run: .kokoro/build.sh
env:
JOB_TYPE: clirr