Follow up previous commit #133
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: Tests 🎳 | |
on: | |
push: | |
tags: | |
- '*' | |
branches: | |
- '*' | |
pull_request: | |
jobs: | |
unittests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
qgis_version: [ | |
"3.22", | |
"3.28", | |
"nightly-release", | |
] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Setup | |
run: | | |
mkdir .local | |
mkdir .cache | |
- name: Run tests | |
run: | |
docker run | |
--rm --name qgis-server | |
-u $(id -u) | |
-v ${GITHUB_WORKSPACE}/.cache:/.cache | |
-e PIP_CACHE_DIR=/.cache | |
-w /src/tests | |
-e PYTEST_ADDOPTS="" | |
-v ${GITHUB_WORKSPACE}:/src | |
-v ${GITHUB_WORKSPACE}/.local:/.local | |
3liz/qgis-platform:${{ matrix.qgis_version }} | |
./run-tests.sh | |
flake8: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
architecture: x64 | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Install flake8 | |
run: pip install flake8 | |
- name: Run flake8 | |
uses: suo/flake8-github-action@releases/v1 | |
with: | |
checkName: 'flake8' # NOTE: this needs to be the same as the job name | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
release: | |
needs: [flake8, unittests] | |
runs-on: ubuntu-latest | |
if: github.repository == '3liz/qgis-wfsOutputExtension' && 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" | |
- uses: actions/[email protected] | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('.github/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install Python requirements | |
run: pip install -r .github/requirements.txt | |
- name : Get 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: Tweet | |
uses: mugi111/[email protected] | |
with: | |
consumer_key: ${{ secrets.TWITTER_CONSUMER_KEY }} | |
consumer_secret: ${{ secrets.TWITTER_CONSUMER_SECRET }} | |
access_token_key: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }} | |
access_token_secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} | |
tweet_body: 'New release WfsOutputExtension ${{ env.RELEASE_VERSION }} for #QGIS Server 🚀 https://github.com/3liz/qgis-wfsOutputExtension/releases' | |
- name: Package the plugin and deploy it in the release | |
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": "wfsOutputExtension", "version": "${{ env.RELEASE_VERSION }}", "url": "https://github.com/3liz/qgis-wfsOutputExtension/releases/latest/download/plugins.xml"}' |