|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +name: Lint |
| 19 | + |
| 20 | +on: |
| 21 | + push: |
| 22 | + pull_request: |
| 23 | + |
| 24 | +concurrency: |
| 25 | + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }} |
| 26 | + cancel-in-progress: true |
| 27 | + |
| 28 | +jobs: |
| 29 | + lint: |
| 30 | + name: Lint (${{ matrix.os }}) |
| 31 | + runs-on: ${{ matrix.os }} |
| 32 | + timeout-minutes: 15 |
| 33 | + strategy: |
| 34 | + fail-fast: false |
| 35 | + matrix: |
| 36 | + os: [ubuntu-latest] |
| 37 | + |
| 38 | + steps: |
| 39 | + - name: Checkout |
| 40 | + uses: actions/checkout@v4 |
| 41 | + |
| 42 | + - name: Setup Go |
| 43 | + uses: actions/setup-go@v5 |
| 44 | + with: |
| 45 | + go-version: "1.23" |
| 46 | + cache: true |
| 47 | + |
| 48 | + - name: Run go mod tidy |
| 49 | + run: go mod tidy |
| 50 | + |
| 51 | + - name: Run golangci-lint |
| 52 | + run: make lint |
| 53 | + |
| 54 | + - name: Check for uncommitted changes |
| 55 | + shell: bash |
| 56 | + run: | |
| 57 | + if [ -n "$(git status --porcelain)" ]; then |
| 58 | + echo "::error::Uncommitted changes detected" |
| 59 | + git status |
| 60 | + git diff |
| 61 | + exit 1 |
| 62 | + fi |
0 commit comments