forked from sandialabs/seat-qgis-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from sandialabs/main
testing
- Loading branch information
Showing
15 changed files
with
2,404 additions
and
1,354 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Black Code Formatter | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
black: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Install Black | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install black | ||
- name: Check Black Formatting | ||
run: black --check . |
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,72 @@ | ||
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" | ||
- name: Clean up Docker container | ||
if: always() | ||
run: | | ||
docker stop qgis-testing-environment | ||
docker rm qgis-testing-environment |
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.