Merge pull request #88 from 3liz/copilot/update-readme-cli-commands #345
This file contains hidden or 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: | |
| - master | |
| - "1.7-aviary" | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| tests: | |
| name: "🎳 Tests" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python: [ | |
| "3.9", | |
| "3.10", | |
| "3.11", | |
| "3.12", | |
| "3.13", | |
| ] | |
| steps: | |
| - name: Get source code | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| cache: "pip" | |
| cache-dependency-path: "requirements/tests.txt" | |
| - name: Install Python requirements | |
| run: | | |
| pip install -r requirements/tests.txt | |
| - name: Run tests | |
| working-directory: tests | |
| run: | | |
| export QGIS_PLUGIN_MANAGER_QGIS_VERSION=3.40 | |
| pytest -v | |
| linter: | |
| name: "❄ Linter" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get source code | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| cache: "pip" | |
| cache-dependency-path: "requirements/lint.txt" | |
| - name: Install Python requirements | |
| run: pip install -r requirements/lint.txt | |
| - name: Run Linter | |
| run: make lint | |
| release: | |
| name: "🚀 Release" | |
| runs-on: ubuntu-latest | |
| needs: [tests, linter] | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Set env | |
| run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
| - name: Get source code | |
| uses: actions/checkout@v6 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| cache: "pip" | |
| cache-dependency-path: "requirements/packaging.txt" | |
| - name: Install Python requirements | |
| run: pip install -r requirements/packaging.txt | |
| - name: Setup | |
| run: | | |
| VERSION=${GITHUB_REF:-0.0.0} | |
| VERSION=${VERSION##*/} | |
| echo ${VERSION} > VERSION | |
| - name: Read the changelog | |
| id: changelog | |
| uses: 3liz/changelog-release@0.4.0 | |
| - name: Build package | |
| run: | | |
| python3 -m build --no-isolation --sdist | |
| - name: Create release on GitHub | |
| uses: ncipollo/release-action@v1.20.0 | |
| with: | |
| body: ${{ steps.changelog.outputs.markdown }} | |
| token: ${{ secrets.BOT_HUB_TOKEN }} | |
| allowUpdates: true | |
| artifacts: "dist/*.tar.gz" | |
| - name: Deploy to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} |