Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
516c8e1
chore: Add initial pom.xml
lqiu96 Nov 17, 2022
28f9763
chore: Convert workflows to maven
lqiu96 Nov 17, 2022
ce05fee
chore: Cleanup the existing workflows
lqiu96 Nov 17, 2022
2366969
chore: Fix format of ci.yaml
lqiu96 Nov 18, 2022
0ad81c9
chore: Fix format of ci.yaml
lqiu96 Nov 18, 2022
aec693d
chore: Use seperate job for java 8
lqiu96 Nov 18, 2022
3ce6058
chore: Update required status checks
lqiu96 Nov 18, 2022
553535e
chore: Run java formatter
lqiu96 Nov 18, 2022
486131f
chore: Resolve checkstyle issues
lqiu96 Nov 18, 2022
3349e12
chore: Empty commit
lqiu96 Nov 18, 2022
a25d266
chore: Run on java 11 or lint job
lqiu96 Nov 18, 2022
27ebf3b
chore: Change to use temurin
lqiu96 Nov 18, 2022
34293da
Merge branch 'main' into main-maven_ci_jobs
lqiu96 Nov 21, 2022
ef10974
chore: Empty commit
lqiu96 Nov 18, 2022
40cb729
chore: Update for PR comments
lqiu96 Nov 22, 2022
9eecd52
chore: Add clirr check in GH actions
lqiu96 Nov 22, 2022
8c30df3
chore: Revert build.gradle to google, inc
lqiu96 Nov 22, 2022
855881d
Merge branch 'main' into main-maven_ci_jobs
lqiu96 Nov 28, 2022
ad1987e
chore: Revert license to Inc.
lqiu96 Nov 28, 2022
bc30ea9
chore: Revert license to Inc.
lqiu96 Nov 28, 2022
e5357ad
chore: Update license in files
lqiu96 Nov 28, 2022
24f8029
chore: Update the rest of the files to correct license
lqiu96 Nov 28, 2022
037acc9
chore: temp add in old ci workflows for status checks
lqiu96 Nov 29, 2022
e9b9957
chore: temp remove required status checks
lqiu96 Nov 29, 2022
b5cb7b2
chore: revert previous commit
lqiu96 Nov 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,65 @@ branchProtectionRules:
- pattern: main
isAdminEnforced: true
requiredStatusCheckContexts:
- units
- format
- units (8)
- units (11)
- units (17)
Comment thread
lqiu96 marked this conversation as resolved.
- lint
- cla/google
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true
requiresStrictStatusChecks: true
- pattern: 1.10.1-sp
isAdminEnforced: true
requiredStatusCheckContexts:
- units
- format
- units (8)
- units (11)
- units (17)
- lint
- cla/google
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true
requiresStrictStatusChecks: true
- pattern: java7
isAdminEnforced: true
requiredStatusCheckContexts:
- units
- format
- units (8)
- units (11)
- units (17)
Comment thread
lqiu96 marked this conversation as resolved.
- lint
- cla/google
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true
requiresStrictStatusChecks: true
- pattern: 2.0.x
isAdminEnforced: true
requiredStatusCheckContexts:
- units
- format
- units (8)
- units (11)
- units (17)
- lint
- cla/google
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true
requiresStrictStatusChecks: true
- pattern: 2.1.x
isAdminEnforced: true
requiredStatusCheckContexts:
- units
- format
- units (8)
- units (11)
- units (17)
- lint
- cla/google
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true
requiresStrictStatusChecks: true
- pattern: 2.2.x
isAdminEnforced: true
requiredStatusCheckContexts:
- units
- format
- units (8)
- units (11)
- units (17)
- lint
- cla/google
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true
Expand Down
115 changes: 98 additions & 17 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,104 @@ jobs:
JVM_OPTS: -Xmx3200m
TERM: dumb
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- run: java -version
- name: Gradle Assemble
run: ./gradlew assemble
- name: Gradle Test
run: ./gradlew test
- name: Gradle Build
run: ./gradlew build publishToMavenLocal
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- run: java -version
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Java Linter
run: ./gradlew googleJavaFormat
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
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-8:
name: units (8) - Maven
runs-on: ubuntu-latest
steps:
- name: Get current week within the year
id: date
run: echo "::set-output name=week_of_year::$(date +'%W' --utc)"
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 8
distribution: temurin
- run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
- run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV
- uses: actions/cache@v3
id: mvn-cache
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }}
- run: .kokoro/build.sh
env:
JOB_TYPE: test
JOB_NAME: units-8
units-maven:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [ 11, 17 ]
steps:
- name: Get current week within the year
id: date
run: echo "::set-output name=week_of_year::$(date +'%W' --utc)"
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{matrix.java}}
- run: java -version
- uses: actions/cache@v3
id: mvn-cache
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }}
- run: .kokoro/build.sh
env:
JOB_TYPE: test
JOB_NAME: units-${{matrix.java}}
lint:
runs-on: ubuntu-latest
steps:
- name: Get current week within the year
id: date
run: echo "::set-output name=week_of_year::$(date +'%W' --utc)"
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- run: java -version
- uses: actions/cache@v3
id: mvn-cache
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }}
- run: java -version
- run: mvn -B -ntp com.coveo:fmt-maven-plugin:check
- run: mvn -B -ntp checkstyle:check@checkstyle
2 changes: 1 addition & 1 deletion .github/workflows/downstream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v3
with:
distribution: zulu
distribution: temurin
java-version: ${{matrix.java}}
- run: java -version
- run: sudo apt-get update -y
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ tmp_gh-pages

# Vim
*.sw*

target/
3 changes: 0 additions & 3 deletions .kokoro/build.bat

This file was deleted.

53 changes: 48 additions & 5 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,54 @@

set -eo pipefail

cd github/api-common-java/
## Get the directory of the build script
scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
## cd to the parent directory, i.e. the root of the git repo
cd ${scriptDir}/..

# Print out Java
# include common functions
source ${scriptDir}/common.sh

function setJava() {
export JAVA_HOME=$1
export PATH=${JAVA_HOME}/bin:$PATH
}

# This project requires compiling the classes in JDK 11 or higher for GraalVM
# classes. Compiling this project with Java 8 or earlier would fail with "class
# file has wrong version 55.0, should be 53.0" and "unrecognized --release 8
# option" (set in build.gradle).
if [ ! -z "${JAVA11_HOME}" ]; then
setJava "${JAVA11_HOME}"
fi

echo "Compiling using Java:"
java -version
echo $JOB_TYPE
mvn clean install -B -Dcheckstyle.skip -Dfmt.skip

# We ensure the generated class files are compatible with Java 8
if [ ! -z "${JAVA8_HOME}" ]; then
setJava "${JAVA8_HOME}"
fi

RETURN_CODE=0

./gradlew assemble
./gradlew build install
case ${JOB_TYPE} in
test)
retry_with_backoff 3 10 \
mvn -B -ntp \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dcheckstyle.skip=true \
-Dflatten.skip=true \
-Danimal.sniffer.skip=true \
-Dmaven.wagon.http.retryHandler.count=5 \
test
RETURN_CODE=$?
;;
clirr)
Comment thread
lqiu96 marked this conversation as resolved.
mvn -B -ntp -Denforcer.skip=true clirr:check
RETURN_CODE=$?
;;
*) ;;
esac
6 changes: 5 additions & 1 deletion .kokoro/coerce_logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
## cd to the parent directory, i.e. the root of the git repo
cd ${scriptDir}/..

job=$(basename ${KOKORO_JOB_NAME})
if [ -z "${KOKORO_JOB_NAME}" ]; then
job="${JOB_NAME}"
else
job=$(basename ${KOKORO_JOB_NAME})
fi

echo "coercing sponge logs..."
for xml in `find . -name *-sponge_log.xml`
Expand Down
25 changes: 0 additions & 25 deletions .kokoro/continuous/common.cfg

This file was deleted.

7 changes: 0 additions & 7 deletions .kokoro/continuous/java11.cfg

This file was deleted.

7 changes: 0 additions & 7 deletions .kokoro/continuous/java7.cfg

This file was deleted.

12 changes: 0 additions & 12 deletions .kokoro/continuous/java8.cfg

This file was deleted.

Loading