Merge branch 'sandialabs:main' into main #3
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: Pylint | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
linting: | |
runs-on: ubuntu-latest | |
services: | |
docker: | |
image: qgis/qgis:latest | |
options: --user root | |
ports: | |
- 99:99 | |
steps: | |
- name: Checkout qgis-plugin | |
uses: actions/checkout@v4 | |
- name: Run QGIS Docker container | |
run: | | |
docker run -d --name qgis-testing-environment \ | |
-v ${GITHUB_WORKSPACE}:/tests_directory \ | |
-e DISPLAY=:99 qgis/qgis:latest tail -f /dev/null | |
- name: Wait for Docker to be ready | |
run: | | |
until docker exec qgis-testing-environment sh -c "ls /"; do sleep 1; done | |
- name: Install plugin manually via Copy | |
run: | | |
docker exec qgis-testing-environment sh -c ' | |
PLUGIN_SRC_PATH=/tests_directory/seat | |
PLUGIN_DEST_DIR=/usr/share/qgis/python/plugins/seat | |
mkdir -p $PLUGIN_DEST_DIR | |
cp -r $PLUGIN_SRC_PATH/* $PLUGIN_DEST_DIR/ | |
' | |
- name: Install Dependencies | |
run: | | |
docker exec qgis-testing-environment sh -c "apt-get update && apt-get install -y python3-pandas python3-netcdf4" | |
- name: Create a Virtual Environment with system site packages | |
run: | | |
docker exec qgis-testing-environment sh -c "/usr/bin/python3.12 -m venv --system-site-packages /tests_directory/venv" | |
- name: Add Plugin to PYTHONPATH in Virtual Environment | |
run: | | |
docker exec qgis-testing-environment sh -c "echo '/usr/share/qgis/python/plugins' > /tests_directory/venv/lib/python3.12/site-packages/seat.pth" | |
- name: Install Pylint in Virtual Environment | |
run: | | |
docker exec qgis-testing-environment sh -c "/tests_directory/venv/bin/pip install pylint" | |
- name: Run Pylint | |
run: | | |
docker exec qgis-testing-environment sh -c "/tests_directory/venv/bin/pylint /tests_directory/seat/modules/velocity_module.py" | |
docker exec qgis-testing-environment sh -c "/tests_directory/venv/bin/pylint /tests_directory/seat/modules/shear_stress_module.py" | |
docker exec qgis-testing-environment sh -c "/tests_directory/venv/bin/pylint /tests_directory/seat/modules/power_module.py" | |
docker exec qgis-testing-environment sh -c "/tests_directory/venv/bin/pylint /tests_directory/seat/modules/stressor_utils.py" | |
docker exec qgis-testing-environment sh -c "/tests_directory/venv/bin/pylint /tests_directory/seat/stressor_receptor_calc.py" | |
- name: Clean up Docker container | |
if: always() | |
run: | | |
docker stop qgis-testing-environment | |
docker rm qgis-testing-environment |