|
1 | | -# Copyright 2022 Google LLC |
2 | | -# |
3 | | -# Licensed under the Apache License, Version 2.0 (the "License"); |
4 | | -# you may not use this file except in compliance with the License. |
5 | | -# You may obtain a copy of the License at |
6 | | -# |
7 | | -# http://www.apache.org/licenses/LICENSE-2.0 |
8 | | -# |
9 | | -# Unless required by applicable law or agreed to in writing, software |
10 | | -# distributed under the License is distributed on an "AS IS" BASIS, |
11 | | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | | -# See the License for the specific language governing permissions and |
13 | | -# limitations under the License. |
14 | | -# Github action job to test core java library features on |
15 | | -# downstream client libraries before they are released. |
16 | | -on: |
| 1 | +'on': |
17 | 2 | push: |
18 | 3 | branches: |
19 | | - - main |
20 | | - pull_request: |
| 4 | + - 1.61.x |
| 5 | + pull_request: null |
21 | 6 | name: ci |
22 | 7 | jobs: |
23 | 8 | units: |
24 | 9 | runs-on: ubuntu-latest |
25 | 10 | strategy: |
26 | 11 | fail-fast: false |
27 | 12 | matrix: |
28 | | - java: [8, 11, 17, 21, 24] |
| 13 | + java: |
| 14 | + - 8 |
| 15 | + - 11 |
| 16 | + - 17 |
| 17 | + - 21 |
| 18 | + - 24 |
29 | 19 | steps: |
30 | | - - name: Get current week within the year |
31 | | - id: date |
32 | | - run: echo "::set-output name=week_of_year::$(date +'%W' --utc)" |
33 | | - - uses: actions/checkout@v4 |
34 | | - - uses: actions/setup-java@v4 |
35 | | - with: |
36 | | - distribution: temurin |
37 | | - java-version: ${{matrix.java}} |
38 | | - - run: java -version |
39 | | - - uses: actions/cache@v4 |
40 | | - id: mvn-cache |
41 | | - with: |
42 | | - path: ~/.m2/repository |
43 | | - key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }} |
44 | | - - run: .kokoro/build.sh |
45 | | - env: |
46 | | - JOB_TYPE: test |
47 | | - JOB_NAME: units-${{matrix.java}} |
| 20 | + - name: Get current week within the year |
| 21 | + id: date |
| 22 | + run: echo "::set-output name=week_of_year::$(date +'%W' --utc)" |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + - uses: actions/setup-java@v4 |
| 25 | + with: |
| 26 | + distribution: temurin |
| 27 | + java-version: ${{matrix.java}} |
| 28 | + - run: java -version |
| 29 | + - uses: actions/cache@v4 |
| 30 | + id: mvn-cache |
| 31 | + with: |
| 32 | + path: ~/.m2/repository |
| 33 | + key: >- |
| 34 | + ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year |
| 35 | + }} |
| 36 | + - run: .kokoro/build.sh |
| 37 | + env: |
| 38 | + JOB_TYPE: test |
| 39 | + JOB_NAME: units-${{matrix.java}} |
48 | 40 | windows: |
49 | 41 | runs-on: windows-latest |
50 | 42 | steps: |
51 | | - - name: Support longpaths |
52 | | - run: git config --system core.longpaths true |
53 | | - - uses: actions/checkout@v4 |
54 | | - - uses: actions/setup-java@v4 |
55 | | - with: |
56 | | - distribution: temurin |
57 | | - java-version: 11 |
58 | | - cache: 'maven' |
59 | | - - run: java -version |
60 | | - - run: .kokoro/build.sh |
61 | | - env: |
62 | | - JOB_TYPE: test |
63 | | - JOB_NAME: windows-units |
| 43 | + - name: Support longpaths |
| 44 | + run: git config --system core.longpaths true |
| 45 | + - uses: actions/checkout@v4 |
| 46 | + - uses: actions/setup-java@v4 |
| 47 | + with: |
| 48 | + distribution: temurin |
| 49 | + java-version: 11 |
| 50 | + cache: maven |
| 51 | + - run: java -version |
| 52 | + - run: .kokoro/build.sh |
| 53 | + env: |
| 54 | + JOB_TYPE: test |
| 55 | + JOB_NAME: windows-units |
64 | 56 | lint: |
65 | 57 | runs-on: ubuntu-latest |
66 | 58 | steps: |
67 | | - - uses: actions/checkout@v4 |
68 | | - with: |
69 | | - fetch-depth: 0 |
70 | | - - uses: actions/setup-java@v4 |
71 | | - with: |
72 | | - distribution: temurin |
73 | | - java-version: 17 |
74 | | - - run: java -version |
75 | | - - run: .kokoro/build.sh |
76 | | - env: |
77 | | - JOB_TYPE: lint |
78 | | - HEAD_SHA: ${{ github.event.pull_request.head.sha }} |
79 | | - BASE_SHA: ${{ github.event.pull_request.base.sha }} |
| 59 | + - uses: actions/checkout@v4 |
| 60 | + with: |
| 61 | + fetch-depth: 0 |
| 62 | + - uses: actions/setup-java@v4 |
| 63 | + with: |
| 64 | + distribution: temurin |
| 65 | + java-version: 17 |
| 66 | + - run: java -version |
| 67 | + - run: .kokoro/build.sh |
| 68 | + env: |
| 69 | + JOB_TYPE: lint |
| 70 | + HEAD_SHA: ${{ github.event.pull_request.head.sha }} |
| 71 | + BASE_SHA: ${{ github.event.pull_request.base.sha }} |
80 | 72 | enforcer: |
81 | 73 | runs-on: ubuntu-latest |
82 | 74 | steps: |
83 | | - - name: Get current week within the year |
84 | | - id: date |
85 | | - run: echo "::set-output name=week_of_year::$(date +'%W' --utc)" |
86 | | - - uses: actions/checkout@v4 |
87 | | - - uses: actions/setup-java@v4 |
88 | | - with: |
89 | | - distribution: temurin |
90 | | - java-version: 11 |
91 | | - cache: maven |
92 | | - - run: java -version |
93 | | - - name: Install Maven modules to local Maven repository |
94 | | - run: | |
95 | | - mvn install -B -ntp -T 1C -DskipTests -Dclirr.skip -Dcheckstyle.skip |
96 | | - - run: java -version |
97 | | - - run: mvn -B -ntp enforcer:enforce@enforce -T 1C |
| 75 | + - name: Get current week within the year |
| 76 | + id: date |
| 77 | + run: echo "::set-output name=week_of_year::$(date +'%W' --utc)" |
| 78 | + - uses: actions/checkout@v4 |
| 79 | + - uses: actions/setup-java@v4 |
| 80 | + with: |
| 81 | + distribution: temurin |
| 82 | + java-version: 11 |
| 83 | + cache: maven |
| 84 | + - run: java -version |
| 85 | + - name: Install Maven modules to local Maven repository |
| 86 | + run: | |
| 87 | + mvn install -B -ntp -T 1C -DskipTests -Dclirr.skip -Dcheckstyle.skip |
| 88 | + - run: java -version |
| 89 | + - run: mvn -B -ntp enforcer:enforce@enforce -T 1C |
98 | 90 | gapic-libraries-bom: |
99 | 91 | runs-on: ubuntu-latest |
100 | 92 | steps: |
101 | | - - uses: actions/checkout@v4 |
102 | | - - uses: actions/setup-java@v4 |
103 | | - with: |
104 | | - java-version: 11 |
105 | | - distribution: temurin |
106 | | - cache: maven |
107 | | - - name: Install Maven modules to local Maven repository |
108 | | - run: | |
109 | | - mvn install -B -ntp -T 1C -DskipTests -Dclirr.skip -Dcheckstyle.skip -Denforcer.skip |
110 | | - - name: Validate gapic-libraries-bom |
111 | | - uses: googleapis/java-cloud-bom/tests/validate-bom@v26.54.0 |
112 | | - with: |
113 | | - bom-path: gapic-libraries-bom/pom.xml |
| 93 | + - uses: actions/checkout@v4 |
| 94 | + - uses: actions/setup-java@v4 |
| 95 | + with: |
| 96 | + java-version: 11 |
| 97 | + distribution: temurin |
| 98 | + cache: maven |
| 99 | + - name: Install Maven modules to local Maven repository |
| 100 | + run: > |
| 101 | + mvn install -B -ntp -T 1C -DskipTests -Dclirr.skip -Dcheckstyle.skip |
| 102 | + -Denforcer.skip |
| 103 | + - name: Validate gapic-libraries-bom |
| 104 | + uses: googleapis/java-cloud-bom/tests/validate-bom@v26.54.0 |
| 105 | + with: |
| 106 | + bom-path: gapic-libraries-bom/pom.xml |
114 | 107 | generation-config-check: |
115 | 108 | runs-on: ubuntu-latest |
116 | 109 | steps: |
117 | | - - uses: actions/checkout@v4 |
118 | | - - name: validate generation configuration |
119 | | - shell: bash |
120 | | - run: | |
121 | | - docker run \ |
122 | | - --rm \ |
123 | | - --quiet \ |
124 | | - -u "$(id -u):$(id -g)" \ |
125 | | - -v "$(pwd):${workspace_name}" \ |
126 | | - --entrypoint python \ |
127 | | - gcr.io/cloud-devrel-public-resources/java-library-generation:"${library_generation_image_tag}" \ |
128 | | - /src/library_generation/cli/entry_point.py validate-generation-config |
129 | | - env: |
130 | | - library_generation_image_tag: 2.60.0 |
131 | | - workspace_name: /workspace |
132 | | - |
133 | | -# TODO: Uncomment the needed Github Actions |
134 | | -# dependencies: |
135 | | -# runs-on: ubuntu-latest |
136 | | -# strategy: |
137 | | -# matrix: |
138 | | -# java: [8, 11, 17] |
139 | | -# steps: |
140 | | -# - uses: actions/checkout@v3 |
141 | | -# - uses: actions/setup-java@v3 |
142 | | -# with: |
143 | | -# distribution: zulu |
144 | | -# java-version: ${{matrix.java}} |
145 | | -# - run: java -version |
146 | | -# - run: .kokoro/dependencies.sh |
147 | | -# clirr: |
148 | | -# runs-on: ubuntu-latest |
149 | | -# steps: |
150 | | -# - uses: actions/checkout@v3 |
151 | | -# - uses: actions/setup-java@v3 |
152 | | -# with: |
153 | | -# distribution: zulu |
154 | | -# java-version: 8 |
155 | | -# - run: java -version |
156 | | -# - run: .kokoro/build.sh |
157 | | -# env: |
158 | | -# JOB_TYPE: clirr |
| 110 | + - uses: actions/checkout@v4 |
| 111 | + - name: validate generation configuration |
| 112 | + shell: bash |
| 113 | + run: | |
| 114 | + docker run \ |
| 115 | + --rm \ |
| 116 | + --quiet \ |
| 117 | + -u "$(id -u):$(id -g)" \ |
| 118 | + -v "$(pwd):${workspace_name}" \ |
| 119 | + --entrypoint python \ |
| 120 | + gcr.io/cloud-devrel-public-resources/java-library-generation:"${library_generation_image_tag}" \ |
| 121 | + /src/library_generation/cli/entry_point.py validate-generation-config |
| 122 | + env: |
| 123 | + library_generation_image_tag: 2.60.1 |
| 124 | + workspace_name: /workspace |
0 commit comments