-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #595 from opengisch/bump-ci
Bumped CI away from ubuntu 22.04 quirks
- Loading branch information
Showing
12 changed files
with
55 additions
and
98 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,17 @@ FROM qgis/qgis:${QGIS_TEST_VERSION} | |
MAINTAINER Matthias Kuhn <[email protected]> | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
python3-pip \ | ||
&& apt-get install -y python3-pip \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY ./requirements.txt /tmp/ | ||
RUN pip3 install --upgrade pip | ||
RUN pip3 install -r /tmp/requirements.txt | ||
|
||
# Upgrading `pip` fixes: "WARNING: Generating metadata for package libqfieldsync produced metadata for project name unknown. Fix your #egg=libqfieldsync fragments." | ||
# However, in QGIS>=3.38, this command fail as `pip` is Debian installed and protected, hence we have `|| true`. | ||
RUN pip3 install --upgrade pip || true | ||
|
||
# images for QGIS<=3.34 uses much older `pip` that does not support `--break-system-packages` | ||
RUN pip3 install -r /tmp/requirements.txt || pip3 install -r /tmp/requirements.txt --break-system-packages | ||
|
||
ENV LANG=C.UTF-8 | ||
|
||
|
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,24 +20,17 @@ on: | |
jobs: | ||
code_check: | ||
name: Code check | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.8 | ||
- name: Install pipenv | ||
run: pip install pipenv | ||
- name: Check code formatting | ||
run: | | ||
pipenv install pre_commit | ||
pipenv run python -m pre_commit run --all-files | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v3 | ||
|
||
- uses: pre-commit/[email protected] | ||
|
||
# Run unit tests | ||
test: | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-24.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -46,20 +39,22 @@ jobs: | |
QGIS_TEST_VERSION: ${{ matrix.qgis_version }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Test | ||
run: | | ||
docker-compose -f .docker/docker-compose.gh.yml run qgis /usr/src/.docker/run-docker-tests.sh | ||
docker compose -f .docker/docker-compose.yml run qgis /usr/src/.docker/run-docker-tests.sh | ||
test-22-04: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Test | ||
run: | | ||
wget -qO - https://qgis.org/downloads/qgis-2022.gpg.key | sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/qgis-archive.gpg --import | ||
|
@@ -68,15 +63,19 @@ jobs: | |
sudo apt update | ||
sudo apt install qgis | ||
sudo pip3 install --upgrade pip | ||
sudo pip3 install pytest nose2 mock | ||
# Upgrading `pip` fixes: "WARNING: Generating metadata for package libqfieldsync produced metadata for project name unknown. Fix your #egg=libqfieldsync fragments." | ||
pip3 install --upgrade pip | ||
# Install dependencies, including `libqfieldsync` | ||
pip3 install -r requirements.txt | ||
xvfb-run pytest | ||
release: | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-24.04 | ||
if: ${{ github.event_name == 'release' }} | ||
env: | ||
OSGEO_USERNAME: mkuhn | ||
OSGEO_PASSWORD: ${{ secrets.OSGEO_PASSWORD }} | ||
|
@@ -85,20 +84,21 @@ jobs: | |
GITHUB_REF: ${{ github.ref }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt update && sudo apt install qtbase5-dev qttools5-dev-tools | ||
sudo pip install qgis-plugin-ci | ||
- name: Package libqfieldsync | ||
run: | | ||
python3 -m pip install pip -U # https://github.com/pypa/setuptools/issues/3269 | ||
pip wheel $(grep -o -P '(https://.*.tar.gz)' requirements.txt) | ||
mv libqfieldsync-*.whl qfieldsync/libqfieldsync.whl | ||
- name: Release | ||
if: ${{ github.event_name == 'release' }} | ||
run: | | ||
RELEASE_VERSION=${GITHUB_REF##*/} | ||
RELEASE_TAG=${GITHUB_REF##*/} | ||
|
@@ -110,54 +110,49 @@ jobs: | |
--osgeo-password ${OSGEO_PASSWORD} \ | ||
--asset-path qfieldsync/libqfieldsync.whl | ||
- name: Package | ||
if: ${{ github.event_name == 'pull_request' }} | ||
run: | | ||
qgis-plugin-ci package 0.1 \ | ||
--asset-path qfieldsync/libqfieldsync.whl | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: qfieldsync-plugin | ||
path: qfieldsync.0.1.zip | ||
package: | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-24.04 | ||
if: ${{ github.event_name == 'workflow_dispatch' }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TX_TOKEN: ${{ secrets.TX_TOKEN }} | ||
GITHUB_REF: ${{ github.ref }} | ||
if: ${{ github.event_name == 'workflow_dispatch' }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
ref: ${{ github.event.inputs.ref }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt update && sudo apt install qtbase5-dev qttools5-dev-tools | ||
sudo pip install qgis-plugin-ci | ||
- name: Release | ||
run: | | ||
qgis-plugin-ci package ${{ github.event.inputs.ref }} --transifex-token ${TX_TOKEN} | ||
- name: Upload release assets | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: qfieldsync.${{ github.event.inputs.ref }}.zip | ||
path: ./qfieldsync.${{ github.event.inputs.ref }}.zip | ||
|
||
translations: | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-24.04 | ||
env: | ||
TX_TOKEN: ${{ secrets.TX_TOKEN }} | ||
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install dependencies | ||
run: sudo pip install qgis-plugin-ci | ||
|
||
- name: 🌍 Push translations | ||
run: | | ||
qgis-plugin-ci push-translation ${TX_TOKEN} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,22 @@ | ||
repos: | ||
# Fix end of files | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
rev: v4.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
args: | ||
- '--fix=lf' | ||
|
||
# Remove unused imports/variables | ||
- repo: https://github.com/myint/autoflake | ||
rev: v1.4 | ||
# Lint and format | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.1.4 | ||
hooks: | ||
- id: autoflake | ||
args: | ||
- "--in-place" | ||
- "--remove-all-unused-imports" | ||
- "--remove-unused-variables" | ||
- "--exclude=__init__.py" | ||
|
||
# Sort imports | ||
- repo: https://github.com/pycqa/isort | ||
rev: "5.12.0" | ||
hooks: | ||
- id: isort | ||
args: ["--profile", "black"] | ||
# Run the linter. | ||
- id: ruff | ||
args: [ --fix ] | ||
|
||
# Black formatting | ||
- repo: https://github.com/psf/black | ||
rev: 22.3.0 | ||
hooks: | ||
- id: black | ||
|
||
# Lint files | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: "3.9.0" | ||
hooks: | ||
- id: flake8 | ||
# Run the formatter. | ||
- id: ruff-format |
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
flake8==2.5.5 | ||
pep8-naming | ||
flake8-respect-noqa | ||
nose2 | ||
pytest | ||
future | ||
transifex-client | ||
|