Skip to content

Merge pull request #141 from 3liz/dependabot/github_actions/actions/c… #482

Merge pull request #141 from 3liz/dependabot/github_actions/actions/c…

Merge pull request #141 from 3liz/dependabot/github_actions/actions/c… #482

Workflow file for this run

name: Tests 🎳
on:
push:
tags:
- '*'
- '!2.13.*'
branches:
- master
pull_request:
branches:
- master
jobs:
linter:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
architecture: x64
- name: Checkout
uses: actions/[email protected]
- name: Cache Python requirements
uses: actions/setup-python@v6
with:
python-version: "3.12"
architecture: x64
cache: "pip"
cache-dependency-path: "requirements/dev.txt"
- name: Install Python requirements
run: pip install -r requirements/lint.txt
- name: Run linter
run: |
ruff check --preview --output-format=concise lizmap_server
mypy lizmap_server
- name: Run security check
run: bandit -r lizmap --severity-level=high
tests:
needs: [linter]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
qgis_version: [
"3.34",
"3.40",
"3.44",
"nightly-release",
]
steps:
- name: Check out repository
uses: actions/[email protected]
with:
submodules: 'true'
- name: Running tests
run: make docker-test QGIS_VERSION=${{ matrix.qgis_version }}
release-dry-run:
runs-on: ubuntu-latest
if: github.repository_owner == '3liz'
steps:
- uses: actions/[email protected]
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
architecture: x64
cache: "pip"
cache-dependency-path: "requirements/packaging.txt"
- name: Set env
run: echo "RELEASE_VERSION=latest" >> $GITHUB_ENV
- name: Install QGIS Plugin CI
run: pip install --quiet -r requirements/packaging.txt
- name: Fetch current changelog
run: |
qgis-plugin-ci changelog ${{ env.RELEASE_VERSION }} >> release.md
cat release.md
- name: Package and deploy the zip
run: >-
qgis-plugin-ci -vv
release ${{ env.RELEASE_VERSION }}
--github-token ${{ secrets.BOT_HUB_TOKEN }}
--osgeo-username ${{ secrets.OSGEO_USERNAME }}
--osgeo-password ${{ secrets.OSGEO_PASSWORD }}
--dry-run
release:
needs: [tests, linter]
runs-on: ubuntu-latest
if: github.repository_owner == '3liz' && contains(github.ref, 'refs/tags/')
steps:
- uses: actions/[email protected]
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
architecture: x64
cache: "pip"
cache-dependency-path: "requirements/packaging.txt"
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Install QGIS Plugin CI
run: pip install --quiet -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/[email protected]
with:
bodyFile: release.md
token: ${{ secrets.BOT_HUB_TOKEN }}
- name: Package and deploy the zip
run: >-
qgis-plugin-ci
release ${{ env.RELEASE_VERSION }}
--github-token ${{ secrets.BOT_HUB_TOKEN }}
--osgeo-username ${{ secrets.OSGEO_USERNAME }}
--osgeo-password ${{ secrets.OSGEO_PASSWORD }}
--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": "lizmap_server", "version": "${{ env.RELEASE_VERSION }}", "url": "https://github.com/3liz/qgis-lizmap-server-plugin/releases/latest/download/plugins.xml"}'