Skip to content

Add a warning about coming crash :( #53

Add a warning about coming crash :(

Add a warning about coming crash :( #53

Workflow file for this run

name: Tests 🎳
on:
push:
tags:
- "*"
branches:
- master
# paths:
# - 'dynamic_layers/**'
# - '.docker/**'
pull_request:
branches:
- master
paths:
- 'dynamic_layers/**'
jobs:
unittests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# - name: Extract branch name
# shell: bash
# run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
# id: extract_branch
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install flake8 pytest
- name: Install APT dependencies
run: |
sudo wget -O /etc/apt/keyrings/qgis-archive-keyring.gpg https://download.qgis.org/downloads/qgis-archive-keyring.gpg
sudo sh -c 'echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/qgis-archive-keyring.gpg] https://qgis.org/ubuntu-ltr $(lsb_release -cs) main" >> /etc/apt/sources.list'
sudo apt update
sudo apt install qgis xvfb
# - name: Lint with flake8
# run: |
# stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
working-directory: tests
run: |
xvfb-run pytest -v
# flake8:
# runs-on: ubuntu-latest
# steps:
#
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# python-version: "3.10"
# architecture: x64
#
# - name: Install Python requirements
# run: pip install -r requirements/dev.txt
#
# - name: Run flake8
# run: flake8
#
# tests:
# runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: .docker
# strategy:
# matrix:
# qgis_version: [
# "release-3_34",
# "release-3_28",
# "latest",
# ]
# steps:
#
# - name: Check out repository
# uses: actions/checkout@v4
#
# - name: Make env
# run: cd .. && make env QGIS_VERSION=${{ matrix.qgis_version }}
#
# - name: Launching docker compose
# run: ./start.sh
#
# - name: Running tests
# run: ./exec.sh
package-commit:
# needs: [test-qgis, flake8]
name: Package commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# To fetch tags
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: "pip"
cache-dependency-path: "requirements/packaging.txt"
# - name: Install Qt lrelease for translations
# run: |
# sudo apt-get update
# sudo apt-get install qttools5-dev-tools
- name: Install Python requirements
run: pip install -r requirements/packaging.txt
- name: Set env
run: |
TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "VERSION=$(echo ${TAG} | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF+1)%(10^length($NF))); print}')-alpha" >> $GITHUB_ENV
- name: Package
run: >-
qgis-plugin-ci
package ${{ env.VERSION }}
- name: Unzip
run: unzip dynamic_layers.${{ env.VERSION }}.zip -d tmp
- uses: actions/upload-artifact@v4
with:
name: dynamic_layers.${{ env.VERSION }}
path: tmp
release:
# needs: [tests, flake8]
runs-on: ubuntu-latest
if: github.repository_owner == '3liz' && contains(github.ref, 'refs/tags/')
steps:
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Qt lrelease
run: |
sudo apt-get update
sudo apt-get install qttools5-dev-tools
- name: Install Python requirements
run: pip install -r requirements/packaging.txt
- name : Fetch current changelog
run: qgis-plugin-ci changelog ${{ env.RELEASE_VERSION }} >> release.md
- name: Create release on GitHub
uses: ncipollo/release-action@v1.14.0
with:
bodyFile: release.md
token: ${{ secrets.BOT_HUB_TOKEN }}
- name: Package and deploy the zip
run: >-
qgis-plugin-ci
-v
release ${{ env.RELEASE_VERSION }}
--transifex-token ${{ secrets.TRANSIFEX_TOKEN }}
--github-token ${{ secrets.BOT_HUB_TOKEN }}
--create-plugin-repo
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.BOT_HUB_TOKEN }}
repository: 3liz/3liz.github.io
event-type: merge-plugins
client-payload: '{"name": "dynamic_layers", "version": "${{ env.RELEASE_VERSION }}", "url": "https://github.com/3liz/QgisDynamicLayersPlugin/releases/latest/download/plugins.xml"}'