| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, |
| # software distributed under the License is distributed on an |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| # KIND, either express or implied. See the License for the |
| # specific language governing permissions and limitations |
| # under the License. |
| |
| name: Dev |
| |
| on: |
| pull_request: |
| types: |
| - opened |
| - edited |
| - reopened |
| - synchronize |
| - ready_for_review |
| push: |
| branches-ignore: |
| - 'dependabot/**' |
| |
| concurrency: |
| group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }} |
| cancel-in-progress: true |
| |
| permissions: |
| contents: read |
| |
| defaults: |
| run: |
| # 'bash' will expand to -eo pipefail |
| shell: bash |
| |
| jobs: |
| check-pr: |
| name: "check PR" |
| if: github.event_name == 'pull_request' |
| runs-on: ubuntu-slim |
| steps: |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| with: |
| fetch-depth: 1 |
| persist-credentials: false |
| # Pings make it into the commit message where they annoy the user every |
| # time the commit gets pushed somewhere |
| - name: Check PR body for pings |
| # Don't check this if it's dependabot - dependabot doesn't ping users |
| # and it tends to include things that look like pings (but are |
| # escaped) |
| if: github.actor != 'dependabot[bot]' |
| env: |
| PR_BODY: ${{ github.event.pull_request.body }} |
| run: | |
| python .github/workflows/dev_pr/body_check.py "$PR_BODY" |
| |
| - name: Check PR title for conventional commit format |
| env: |
| PR_TITLE: ${{ github.event.pull_request.title }} |
| run: | |
| python dev/adbc_dev/title_check.py $(pwd) "$PR_TITLE" |
| |
| pre-commit: |
| name: "pre-commit" |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| with: |
| fetch-depth: 1 |
| persist-credentials: false |
| - name: Get required Go version |
| run: | |
| (. .env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV |
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 |
| with: |
| go-version: "${{ env.GO_VERSION }}" |
| check-latest: true |
| - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 |
| with: |
| python-version: '3.x' |
| - name: install golangci-lint |
| run: | |
| go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.49.0 |
| - name: pre-commit (cache) |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 |
| with: |
| path: ~/.cache/pre-commit |
| key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} |
| - name: pre-commit (--all-files) |
| run: | |
| python -m pip install pre-commit |
| pre-commit run --show-diff-on-failure --color=always --all-files |