-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: run lint check on every PR (#43)
This commit includes a lint check on every PR.
- Loading branch information
Showing
14 changed files
with
230 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
[flake8] | ||
per-file-ignores = | ||
# line too long | ||
*py: E501, | ||
extend-ignore = | ||
H101, | ||
E501 | ||
exclude = | ||
.git, | ||
.github, | ||
__pycache__, | ||
generation_pb2.py, | ||
generation_pb2_grpc.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
name: linters | ||
on: | ||
pull_request: | ||
push: | ||
# Run the functional tests every 8 hours. | ||
# This will help to identify faster if | ||
# there is a CI failure related to a | ||
# change in any dependency. | ||
schedule: | ||
- cron: '0 */8 * * *' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: [3.9] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Run a commitlint | ||
uses: wagoid/commitlint-github-action@v2 | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install jq libyaml-dev git build-essential findutils -y | ||
sudo python3 -m pip install -r test-requirements.txt | ||
sudo python3 -m pip install --upgrade --ignore-installed PyYAML | ||
sudo python3 -m pip install --upgrade pip | ||
sudo python3 -m pip install --upgrade virtualenv | ||
sudo python3 -m pip install --upgrade setuptools | ||
- name: Run Linters | ||
run: | | ||
tox -e linters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,36 @@ | ||
trigger: | ||
- main | ||
- main | ||
|
||
variables: | ||
- name: UBUNTU_DEP_LIST | ||
value: "podman pylint python3-boto3 python3-deprecation python3-flake8 python3-numpy python3-pip yajl-tools yamllint" | ||
- name: MACOS_DEP_LIST | ||
value: "ghz yajl python" | ||
- name: GHZ_URL | ||
value: "https://github.com/dagrayvid/ghz" | ||
- name: UBUNTU_DEP_LIST | ||
value: "podman pylint python3-boto3 python3-deprecation python3-flake8 python3-numpy python3-pip yajl-tools yamllint" | ||
- name: MACOS_DEP_LIST | ||
value: "ghz yajl python" | ||
- name: GHZ_URL | ||
value: "https://github.com/dagrayvid/ghz" | ||
|
||
stages: | ||
- stage: lint | ||
jobs: | ||
- job: macOS_lint | ||
pool: | ||
vmImage: "macOS-latest" | ||
steps: | ||
- script: | | ||
brew install ${MACOS_DEP_LIST} | ||
displayName: "install deps" | ||
- script: | | ||
pip install -r requirements.txt | ||
- script: | | ||
sh validate.sh || true | ||
displayName: "macOS linter - pip" | ||
- job: Linux_lint | ||
pool: | ||
vmImage: ubuntu-latest | ||
steps: | ||
- script: | | ||
sudo apt-get install -y ${UBUNTU_DEP_LIST} | ||
displayName: "install deps" | ||
- script: | | ||
sh validate.sh || true | ||
displayName: "Linux linter - Ubuntu packages" | ||
- stage: lint | ||
jobs: | ||
- job: macOS_lint | ||
pool: | ||
vmImage: "macOS-latest" | ||
steps: | ||
- script: | | ||
brew install ${MACOS_DEP_LIST} | ||
displayName: "install deps" | ||
- script: | | ||
pip install -r requirements.txt | ||
- script: | | ||
sh validate.sh || true | ||
displayName: "macOS linter - pip" | ||
- job: Linux_lint | ||
pool: | ||
vmImage: ubuntu-latest | ||
steps: | ||
- script: | | ||
sudo apt-get install -y ${UBUNTU_DEP_LIST} | ||
displayName: "install deps" | ||
- script: | | ||
sh validate.sh || true | ||
displayName: "Linux linter - Ubuntu packages" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.