Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add GEEST2 project files #242

Merged
merged 15 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build documentation
on: workflow_dispatch

jobs:
build-docs:
runs-on: ubuntu-20.04
container:
image: qgis/qgis:release-3_16
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Fix Python command
run: apt-get install python-is-python3

- name: Install plugin dependencies
run: pip install -r requirements-dev.txt

- name: Generate plugin repo XML
run: python admin.py --verbose generate-plugin-repo-xml

- name: Update the documentation
run: mkdocs gh-deploy --force
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Continuous Integration

on:
push:
branches:
- main
pull_request:
types:
- edited
- opened
- reopened
- synchronize
branches:
- main
env:
# Global environment variable
IMAGE: qgis/qgis
WITH_PYTHON_PEP: "true"
MUTE_LOGS: "true"

jobs:
test:
runs-on: ${{ matrix.os }}
name: Running tests on ${{ matrix.os }} using QGIS ${{ matrix.qgis_version_tag }}

strategy:
fail-fast: false
matrix:
qgis_version_tag:
- release-3_30
- release-3_32
- release-3_34
- release-3_36
os: [ubuntu-22.04]

steps:

- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive

- name: Preparing docker-compose environment
env:
QGIS_VERSION_TAG: ${{ matrix.qgis_version_tag }}
run: |
cat << EOF > .env
QGIS_VERSION_TAG=${QGIS_VERSION_TAG}
IMAGE=${IMAGE}
ON_TRAVIS=true
MUTE_LOGS=${MUTE_LOGS}
WITH_PYTHON_PEP=${WITH_PYTHON_PEP}
EOF
- name: Install python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install plugin dependencies
run: pip install -r requirements-dev.txt

- name: Preparing test environment
run: |
cat .env
docker pull "${IMAGE}":${{ matrix.qgis_version_tag }}
python admin.py build --tests
docker compose up -d
sleep 10

- name: Run test suite
run: |
docker compose exec -T qgis-testing-environment qgis_testrunner.sh test_suite.test_package
33 changes: 33 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish to GitHub Pages

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
- name: Dependencies
run: |
pip install -r docs/requirements.txt
- name: Build Jupyter Book
run: |
jupyter-book build . --config docs/_config.yml --toc docs/_toc.yml
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main' && job.status == 'success'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build/html
enable_jekyll: false
76 changes: 76 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Create a release
on:
push:
tags:
- "v*"

jobs:
create-release:
runs-on: ubuntu-22.04
container:
image: qgis/qgis:release-3_34
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Fix Python command
run: apt-get install python-is-python3

- name: Install python
uses: actions/setup-python@v4

- name: Install plugin dependencies
run: pip install -r requirements-dev.txt

- name: Get experimental info
id: get-experimental
run: |
echo "::set-output name=IS_EXPERIMENTAL::$(python -c "import json; f = open('config.json'); data=json.load(f); print(str(data['general']['experimental']).lower())")"

- name: Create release from tag
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
prerelease: ${{ steps.get-experimental.outputs.IS_EXPERIMENTAL }}
draft: false

- name: Generate zip
run: python admin.py generate-zip

- name: get zip details
id: get-zip-details
run: |
echo "::set-output name=ZIP_PATH::dist/$(ls dist)\n"
echo "::set-output name=ZIP_NAME::$(ls dist)"

- name: Upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url}}
asset_path: ${{ steps.get-zip-details.outputs.ZIP_PATH}}
asset_name: ${{ steps.get-zip-details.outputs.ZIP_NAME}}
asset_content_type: application/zip

- name: Checkout code
uses: actions/checkout@v2
with:
ref: release
- name: Update custom plugin repository to include latest release
run: |
echo "$(python admin.py generate-plugin-repo-xml)" >> docs/repository/plugins.xml
python admin.py --verbose generate-plugin-repo-xml
echo " " >> docs/repository/plugins.xml
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global --add safe.directory /__w/GEEST/GEEST

git add -A
git commit -m "Update on plugins.xml"
git push origin release
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ pip-delete-this-directory.txt

# VS Code
.vscode/
.vscode-extensions/

# Nix
result/
nix-result/

# nix
.direnv/
Loading
Loading