Skip to content

Commit bd9afcd

Browse files
authored
chore(ci): run pre-commit across the repo (apache#26942)
1 parent 0bc5983 commit bd9afcd

2 files changed

Lines changed: 54 additions & 45 deletions

File tree

‎.github/workflows/pre-commit.yml‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: pre-commit checks
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
pull_request:
8+
types: [synchronize, opened, reopened, ready_for_review]
9+
10+
jobs:
11+
pre-commit:
12+
runs-on: ubuntu-20.04
13+
strategy:
14+
matrix:
15+
python-version: ["3.9"]
16+
steps:
17+
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
18+
uses: actions/checkout@v3
19+
with:
20+
persist-credentials: false
21+
submodules: recursive
22+
- name: Setup Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
cache: "pip"
27+
cache-dependency-path: |
28+
requirements/base.txt
29+
requirements/integration.txt
30+
- name: Install dependencies
31+
uses: ./.github/actions/cached-dependencies
32+
with:
33+
run: |
34+
apt-get-install
35+
pip-upgrade
36+
pip install wheel
37+
pip install -r requirements/base.txt
38+
pip install -r requirements/integration.txt
39+
# Add brew to the path - see https://github.com/actions/runner-images/issues/6283
40+
- name: Enable brew and helm-docs
41+
run: |
42+
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
43+
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
44+
echo "HOMEBREW_PREFIX=$HOMEBREW_PREFIX" >>"${GITHUB_ENV}"
45+
echo "HOMEBREW_CELLAR=$HOMEBREW_CELLAR" >>"${GITHUB_ENV}"
46+
echo "HOMEBREW_REPOSITORY=$HOMEBREW_REPOSITORY" >>"${GITHUB_ENV}"
47+
brew install norwoodj/tap/helm-docs
48+
- name: pre-commit
49+
run: |
50+
if ! pre-commit run --all-files; then
51+
git status
52+
git diff
53+
exit 1
54+
fi

‎.github/workflows/superset-python-misc.yml‎

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -52,51 +52,6 @@ jobs:
5252
# `-j 0` run Pylint in parallel
5353
run: pylint -j 0 superset
5454

55-
pre-commit:
56-
runs-on: ubuntu-20.04
57-
strategy:
58-
matrix:
59-
python-version: ["3.9"]
60-
steps:
61-
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
62-
uses: actions/checkout@v3
63-
with:
64-
persist-credentials: false
65-
submodules: recursive
66-
- name: Setup Python
67-
uses: actions/setup-python@v4
68-
with:
69-
python-version: ${{ matrix.python-version }}
70-
cache: "pip"
71-
cache-dependency-path: |
72-
requirements/base.txt
73-
requirements/integration.txt
74-
- name: Install dependencies
75-
uses: ./.github/actions/cached-dependencies
76-
with:
77-
run: |
78-
apt-get-install
79-
pip-upgrade
80-
pip install wheel
81-
pip install -r requirements/base.txt
82-
pip install -r requirements/integration.txt
83-
# Add brew to the path - see https://github.com/actions/runner-images/issues/6283
84-
- name: Enable brew and helm-docs
85-
run: |
86-
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
87-
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
88-
echo "HOMEBREW_PREFIX=$HOMEBREW_PREFIX" >>"${GITHUB_ENV}"
89-
echo "HOMEBREW_CELLAR=$HOMEBREW_CELLAR" >>"${GITHUB_ENV}"
90-
echo "HOMEBREW_REPOSITORY=$HOMEBREW_REPOSITORY" >>"${GITHUB_ENV}"
91-
brew install norwoodj/tap/helm-docs
92-
- name: pre-commit
93-
run: |
94-
if ! pre-commit run --all-files; then
95-
git status
96-
git diff
97-
exit 1
98-
fi
99-
10055
babel-extract:
10156
runs-on: ubuntu-20.04
10257
strategy:

0 commit comments

Comments
 (0)