From 7a82779649fd0ce58be4445d17607052d6b0e803 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Thu, 21 May 2020 12:20:19 -0700 Subject: [PATCH] chore: fix sample snippet tag to fix synth and update common templates --- .github/workflows/ci.yaml | 76 +++++++++++++++++++ .gitignore | 1 + .kokoro/build.bat | 2 +- CONTRIBUTING.md | 11 ++- .../java/pubsublite/DeleteTopicExample.java | 2 +- synth.metadata | 4 +- synth.py | 1 + 7 files changed, 92 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..445b4bf82 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,76 @@ +on: + push: + branches: + - master + pull_request: +name: ci +jobs: + units: + runs-on: ubuntu-latest + strategy: + matrix: + java: [7, 8, 11] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: test + - name: coverage + uses: codecov/codecov-action@v1 + with: + name: actions ${{matrix.java}} + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.bat + env: + JOB_TYPE: test + dependencies: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/dependencies.sh + linkage-monitor: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/linkage-monitor.sh + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: lint + clirr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: clirr \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7532c2dd5..86083d151 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ hs_err_pid* # intellij project folder .idea/ +*.iml # maven build directory target/ diff --git a/.kokoro/build.bat b/.kokoro/build.bat index 85cf4bc04..05826ad93 100644 --- a/.kokoro/build.bat +++ b/.kokoro/build.bat @@ -1,3 +1,3 @@ :: See documentation in type-shell-output.bat -"C:\Program Files\Git\bin\bash.exe" github/java-pubsublite/.kokoro/build.sh +"C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 085021dde..f2dbdee06 100755 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -99,7 +99,16 @@ mvn -Penable-samples clean verify ``` 2. [Activate](#profile-activation) the profile. -3. Define your samples in a normal Maven project in the `samples/` directory +3. Define your samples in a normal Maven project in the `samples/` directory. + +### Code Formatting + +Code in this repo is formatted with +[google-java-format](https://github.com/google/google-java-format). +To run formatting on your project, you can run: +``` +mvn com.coveo:fmt-maven-plugin:format +``` ### Profile Activation diff --git a/samples/snippets/src/main/java/pubsublite/DeleteTopicExample.java b/samples/snippets/src/main/java/pubsublite/DeleteTopicExample.java index 0da6af0de..899ef1a44 100644 --- a/samples/snippets/src/main/java/pubsublite/DeleteTopicExample.java +++ b/samples/snippets/src/main/java/pubsublite/DeleteTopicExample.java @@ -72,4 +72,4 @@ public static void deleteTopicExample( throw statusException; } } -} // [START pubsublite_delete_topic] +} // [END pubsublite_delete_topic] diff --git a/synth.metadata b/synth.metadata index 9c5712058..e73cc6ed7 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "git@github.com:googleapis/java-pubsublite.git", - "sha": "579eaab949bf7e92ae3fc5c877fb3b7bb3370632" + "sha": "2faceb03ec7c91c07b1353d74b244aa763140ab0" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "01b6f23d24b27878b48667ce597876d66b59780e" + "sha": "7ee92820e64c0aea379781b82399d6b3f3c8655f" } } ] diff --git a/synth.py b/synth.py index f5672ed5c..d522e76a7 100644 --- a/synth.py +++ b/synth.py @@ -19,6 +19,7 @@ # TODO: generate library protos when publicly available java.common_templates(excludes=[ + '.kokoro/*/samples.cfg', # TODO: allow README generation when public 'README.md', # TODO: allow when pubsublite is available in libraries-bom