blob: b6a1f84338c0fbb55b2b63d991a486c4c0acd83f [file] [log] [blame]
name: lint
on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize
push:
branches:
- main
- feature/*
concurrency:
group: '${{ github.workflow }}-${{ github.event_name }}-${{ inputs.platform }} @ ${{ github.event.pull_request.number || github.sha }}'
cancel-in-progress: true
permissions: {}
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Install clang-format Dependencies
run: |
sudo apt-get update
sudo apt-get install libncurses5
- name: Download GN via CIPD
env:
GN_SHA256SUM: 'af7b2dcb3905bca56655e12131b365f1cba8e159db80d2022330c4f522fab2ef /tmp/gn.zip'
GN_HASH: r3styzkFvKVmVeEhMbNl8cuo4VnbgNICIzDE9SL6su8C
run: |
set -e -x
curl --location --silent --output /tmp/gn.zip "https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+/${GN_HASH}"
echo ${GN_SHA256SUM} | sha256sum --check
unzip /tmp/gn.zip -d /usr/local/bin
rm /tmp/gn.zip
- name: Checkout
uses: kaidokert/checkout@v3.5.999
timeout-minutes: 30
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install Pip Packages
run: pip install --require-hashes --no-deps -r ${GITHUB_WORKSPACE}/precommit_hooks/requirements.txt
- name: Download Resources
run: python ${GITHUB_WORKSPACE}/download_resources.py
- name: Run pre-commit
uses: ./.github/actions/pre_commit
with:
base_ref: ${{ github.event.pull_request.base.sha && github.event.pull_request.base.sha || github.event.before }}
check-bug-id:
name: Check Bug ID
runs-on: ubuntu-latest
steps:
- name: Check Bug ID Present
# v2
uses: gsactions/commit-message-checker@16fa2d5de096ae0d35626443bcd24f1e756cafee
with:
accessToken: ${{ secrets.GITHUB_TOKEN }}
pattern: '(b\/\d+|^(Bug|Fixed|Issue): \d+$)'
flags: 'gm'
error: 'PR title or description should include at least one bug ID.'