|
| 1 | +# |
| 2 | +# Copyright © 2026-2026 ThingsBoard, Inc. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | +# |
| 16 | + |
| 17 | +name: CI |
| 18 | + |
| 19 | +on: |
| 20 | + push: |
| 21 | + branches: [ master ] |
| 22 | + pull_request: |
| 23 | + branches: [ master ] |
| 24 | + |
| 25 | +concurrency: |
| 26 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 27 | + cancel-in-progress: true |
| 28 | + |
| 29 | +jobs: |
| 30 | + build: |
| 31 | + name: Build |
| 32 | + runs-on: ubuntu-latest |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v4 |
| 35 | + |
| 36 | + - name: Set up Java 25 |
| 37 | + uses: actions/setup-java@v4 |
| 38 | + with: |
| 39 | + distribution: temurin |
| 40 | + java-version: 25 |
| 41 | + cache: maven |
| 42 | + |
| 43 | + - name: Build |
| 44 | + run: mvn clean install -DskipTests |
| 45 | + |
| 46 | + verify-codegen: |
| 47 | + name: Verify codegen |
| 48 | + runs-on: ubuntu-latest |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v4 |
| 51 | + |
| 52 | + - name: Set up Java 25 |
| 53 | + uses: actions/setup-java@v4 |
| 54 | + with: |
| 55 | + distribution: temurin |
| 56 | + java-version: 25 |
| 57 | + cache: maven |
| 58 | + |
| 59 | + - name: Set up Node.js 20 |
| 60 | + uses: actions/setup-node@v4 |
| 61 | + with: |
| 62 | + node-version: 20 |
| 63 | + |
| 64 | + - name: Install openapi-generator-cli |
| 65 | + run: npm install -g @openapitools/openapi-generator-cli |
| 66 | + |
| 67 | + - name: Regenerate all clients |
| 68 | + run: ./generate-client.sh all |
| 69 | + |
| 70 | + - name: Check for drift |
| 71 | + run: | |
| 72 | + if ! git diff --cached --exit-code; then |
| 73 | + echo "" |
| 74 | + echo "Generated code is out of sync with specs." |
| 75 | + echo "Run './generate-client.sh all' locally and commit the changes." |
| 76 | + exit 1 |
| 77 | + fi |
0 commit comments