|
| 1 | +<% if private %> |
| 2 | +# Copyright (c) 2025 Columnar Technologies Inc. All rights reserved. |
| 3 | +<% else %> |
| 4 | +# Copyright (c) 2025 ADBC Drivers Contributors |
| 5 | +# |
| 6 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | +# you may not use this file except in compliance with the License. |
| 8 | +# You may obtain a copy of the License at |
| 9 | +# |
| 10 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +# |
| 12 | +# Unless required by applicable law or agreed to in writing, software |
| 13 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | +# See the License for the specific language governing permissions and |
| 16 | +# limitations under the License. |
| 17 | +<% endif %> |
| 18 | + |
| 19 | +# This is a common workflow for performing basic PR checks like running |
| 20 | +# pre-commit. |
| 21 | + |
| 22 | +name: Dev |
| 23 | + |
| 24 | +on: |
| 25 | + pull_request: {} |
| 26 | + push: |
| 27 | + branches: |
| 28 | + - main |
| 29 | + |
| 30 | +concurrency: |
| 31 | + group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }} |
| 32 | + cancel-in-progress: true |
| 33 | + |
| 34 | +defaults: |
| 35 | + run: |
| 36 | + shell: bash |
| 37 | + |
| 38 | +permissions: |
| 39 | + contents: read |
| 40 | + |
| 41 | +jobs: |
| 42 | + lint: |
| 43 | + name: "lint & pre-commit" |
| 44 | + runs-on: ubuntu-latest |
| 45 | + |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 48 | + with: |
| 49 | + fetch-depth: 0 |
| 50 | + persist-credentials: false |
| 51 | + |
| 52 | +<% if lang.go %> |
| 53 | + - uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 |
| 54 | + with: |
| 55 | + cache-dependency-path: go/go.sum |
| 56 | + check-latest: true |
| 57 | + go-version-file: go/go.mod |
| 58 | +<% endif %> |
| 59 | + |
| 60 | + - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 |
| 61 | + with: |
| 62 | + python-version: "3.x" |
| 63 | + |
| 64 | + - name: Install |
| 65 | + run: pip install pre-commit |
| 66 | + |
| 67 | + - name: pre-commit (cache) |
| 68 | + uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 |
| 69 | + with: |
| 70 | + path: ~/.cache/pre-commit |
| 71 | + key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} |
| 72 | + |
| 73 | + - name: pre-commit |
| 74 | + run: | |
| 75 | + pre-commit run --all-files --color=always --show-diff-on-failure --verbose |
0 commit comments