-
Notifications
You must be signed in to change notification settings - Fork 31
70 lines (66 loc) · 2.19 KB
/
lint.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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/[email protected]
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).'