Bump micromatch from 4.0.5 to 4.0.8 in /plugins/grafana-custom-plugins/grafana-dependency-plugin #2600
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
name: Python | |
on: | |
pull_request: | |
branches: | |
- main | |
- release-* | |
- feature/* | |
push: | |
branches: | |
- main | |
- release-* | |
- feature/* | |
jobs: | |
check-python-changes: | |
name: Check whether tests need to be run based on diff | |
runs-on: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: antrea-io/has-changes@v2 | |
id: check_diff | |
with: | |
paths: plugins/policy-recommendation/* plugins/anomaly-detection/* | |
outputs: | |
has_changes: ${{ steps.check_diff.outputs.has_changes }} | |
python-lint: | |
needs: check-python-changes | |
if: ${{ needs.check-python-changes.outputs.has_changes == 'yes' }} | |
name: Python Lint | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.9"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Check-out code | |
uses: actions/checkout@v4 | |
# H106: Don't put vim configuration in source files | |
# H203: Use assertIs(Not)None to check for None | |
# H204: Use assert(Not)Equal to check for equality | |
# H205: Use assert(Greater|Less)(Equal) for comparison | |
# E125 continuation line does not distinguish itself from next logical line | |
# E126 continuation line over-indented for hanging indent | |
# E128 continuation line under-indented for visual indent | |
# E129 visually indented line with same indent as next logical line | |
# E265 block comment should start with '#' | |
# H305 imports not grouped correctly | |
# H307 like imports should be grouped together | |
# H404 multi line docstring should start with a summary | |
# H405 multi line docstring summary not separated with an empty line | |
# I202 Additional newline in a group of imports | |
# H904 Wrap long lines in parentheses instead of a backslash | |
# TODO(dougwig) -- uncomment this to test for remaining linkages | |
# N530 direct neutron imports not allowed | |
# N531 translations hints | |
# W504 line break after binary operator | |
- name: Install Lint dependencies with flake8 | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 | |
- name: Lint with flake8 on policy-recommendation | |
run: | | |
flake8 --ignore E125,E126,E128,E129,E265,H305,H307,H404,H405,H904,N530,N531,W504,I202 \ | |
--enable-extensions H106,H203,H204,H205 \ | |
--show-source \ | |
--count \ | |
--statistic \ | |
plugins/policy-recommendation/ | |
- name: Lint with flake8 on anomaly-detection | |
run: | | |
flake8 --ignore E125,E126,E128,E129,E265,H305,H307,H404,H405,H904,N530,N531,W504,I202 \ | |
--enable-extensions H106,H203,H204,H205 \ | |
--show-source \ | |
--count \ | |
--statistic \ | |
plugins/anomaly-detection/ | |
test-unit: | |
needs: check-python-changes | |
if: ${{ needs.check-python-changes.outputs.has_changes == 'yes' }} | |
name: Unit test | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.9"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Check-out code | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pytest-cov | |
python -m pip install -r plugins/policy-recommendation/requirements.txt | |
python -m pip install -r plugins/anomaly-detection/requirements.txt | |
- name: Run policy-recommendation unit tests | |
run: | | |
cd plugins/policy-recommendation/ | |
pytest -vv --cov . --cov-report xml | |
- name: Run anomaly-detection unit tests | |
run: | | |
cd plugins/anomaly-detection/ | |
pytest -vv --cov . --cov-report xml | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: plugins/policy-recommendation/coverage.xml,plugins/anomaly-detection/coverage.xml | |
flags: python-coverage | |
check-udf-changes: | |
name: Check whether udf tests need to be run based on diff | |
runs-on: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: antrea-io/has-changes@v2 | |
id: check_diff | |
with: | |
paths: snowflake/udfs/udfs/* | |
outputs: | |
has_changes: ${{ steps.check_diff.outputs.has_changes }} | |
test-udf: | |
needs: check-udf-changes | |
if: ${{ needs.check-udf-changes.outputs.has_changes == 'yes' }} | |
name: Udf test | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.9"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Check-out code | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
python -m pip install six psutil python-dateutil urllib3 requests pyyaml pandas | |
wget https://downloads.antrea.io/artifacts/snowflake-udf/k8s-client-python-v24.2.0.zip | |
unzip k8s-client-python-v24.2.0.zip -d snowflake/udfs/udfs/ | |
- name: Run udf tests | |
run: | | |
make -C snowflake/udfs/udfs check |