-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI - Switch from GitLab to GitHub (#1)
* Add autolabeler and dependabot * Add linter and doc builder * Replace gitlab ref by github * Remove gitlab configuration * Push new workflows * Remove azure ci * Version * Change settings path * use pytest as module
- Loading branch information
Showing
15 changed files
with
275 additions
and
246 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: pip | ||
directory: "/requirements" | ||
schedule: | ||
interval: monthly | ||
time: "17:00" | ||
timezone: Europe/Paris | ||
labels: | ||
- dependencies | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" | ||
labels: | ||
- ci-cd |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ci-cd: | ||
- .github/**/* | ||
|
||
dependencies: | ||
- ./requirements.txt | ||
- ./requirements/*.txt | ||
|
||
documentation: | ||
- docs/**/* |
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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: "📦 Build" | ||
|
||
# Triggers | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
paths: | ||
- ".github/workflows/build.yml" | ||
- "builder/**/*" | ||
- "qgis_deployment_toolbelt/**/*.py" | ||
|
||
tags: "*" | ||
|
||
# Globals | ||
env: | ||
PROJECT_FOLDER: "qgis_deployment_toolbelt" | ||
PYTHON_VERSION: 3.8 | ||
PYINSTALLER_LOG_LEVEL: "DEBUG" | ||
|
||
# Jobs definition | ||
jobs: | ||
build-windows: | ||
name: "📦 Windows" | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Get source code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install project requirements | ||
run: | | ||
python -m pip install -U pip setuptools wheel | ||
python -m pip install -U -r requirements/base.txt | ||
python -m pip install -U -r requirements/development.txt | ||
- name: Install project as a package | ||
run: python -m pip install -e . | ||
|
||
- name: Generates MS Version Info | ||
run: python .\builder\version_info_templater.py | ||
|
||
- name: Generates MS Executable | ||
run: python -O .\builder\pyinstaller_build_windows.py | ||
|
||
- name: Save it as artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: qgis_deployment_toolbelt_windows_executable | ||
path: dist/qgis_deployment_toolbelt* | ||
|
||
release: | ||
name: "Release on tag 🚀" | ||
|
||
runs-on: ubuntu-latest | ||
|
||
needs: [build-windows] | ||
|
||
if: startsWith(github.ref, 'refs/tags/') | ||
|
||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: qgis_deployment_toolbelt_windows_executable | ||
path: builds/windows/ | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: "Version ${{ github.ref }}" | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Add Windows executable as release Asset | ||
id: upload-release-asset-windows | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: builds/windows/ | ||
asset_name: qgis_deployment_toolbelt_windows_executable.zip | ||
asset_content_type: application/zip |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "📚 Documentation" | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- "docs/**/*" | ||
- ".github/workflows/documentation.yml" | ||
- "qgis_deployment_toolbelt/**/*.py" | ||
|
||
env: | ||
PYTHON_VERSION: 3.8 | ||
|
||
jobs: | ||
build-docs: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Get source code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install project requirements | ||
run: | | ||
python -m pip install -U pip setuptools wheel | ||
python -m pip install -U -r requirements/base.txt | ||
python -m pip install -U -r requirements/development.txt | ||
python -m pip install -U -r requirements/documentation.txt | ||
python -m pip install -e . | ||
- name: Build doc using Sphinx | ||
run: sphinx-build -b html docs docs/_build/html | ||
|
||
- name: Deploy to GitHub Pages | ||
run: ghp-import --force --no-history --no-jekyll --push docs/_build/html |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: 🐍 Linter | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- "**.py" | ||
|
||
pull_request: | ||
branches: [main] | ||
paths: | ||
- "**.py" | ||
|
||
env: | ||
PROJECT_FOLDER: "qgis_deployment_toolbelt" | ||
PYTHON_VERSION: 3.8 | ||
|
||
jobs: | ||
lint-ubuntu: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Get source code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install requirements | ||
run: | | ||
python -m pip install -U pip setuptools wheel | ||
python -m pip install -U "flake8>=3.7,<3.9" | ||
- name: Lint with flake8 | ||
run: | | ||
flake8 ${{ env.PROJECT_FOLDER }} --count --select=E9,F63,F7,F82 --show-source --statistics | ||
flake8 ${{ env.PROJECT_FOLDER }} --count --exit-zero --statistics |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: "🏷 PR Labeler" | ||
on: | ||
- pull_request_target | ||
|
||
jobs: | ||
triage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/labeler@v3 | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
sync-labels: true |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: "🎳 Tester" | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- "**/*.py" | ||
- ".github/workflows/tests.yml" | ||
pull_request: | ||
branches: [main] | ||
paths: | ||
- "**/*.py" | ||
- ".github/workflows/tests.yml" | ||
|
||
env: | ||
PROJECT_FOLDER: "qgis_deployment_toolbelt" | ||
PYTHON_VERSION: 3.8 | ||
|
||
jobs: | ||
unit-test: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Get source code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install project requirements | ||
run: | | ||
python -m pip install -U pip setuptools wheel | ||
python -m pip install -U -r requirements/base.txt | ||
python -m pip install -U -r requirements/development.txt | ||
- name: Install project as a package | ||
run: python -m pip install -e . | ||
|
||
- name: Unit tests | ||
run: python -m pytest | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 |
Oops, something went wrong.