blob: 6a138cbea435ff7914a5581e06c0325674599cd5 [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
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
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '^3.7.x'
- name: Install Pip Packages
run: pip install -r ${GITHUB_WORKSPACE}/requirements.txt
- name: Download Resources
run: python ${GITHUB_WORKSPACE}/download_resources.py
- name: 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:
excludeTitle: true
excludeDescription: true
checkAllCommitMessages: true
accessToken: ${{ secrets.GITHUB_TOKEN }}
pattern: '^b\/\d+$'
flags: 'gm'
error: 'Commit message should include at least one bug ID on a separate line (e.g. b/12345).'