Skip to content

Commit 978115e

Browse files
authored
Merge pull request #1 from views-platform/development
Development
2 parents a6c9fae + 483ce72 commit 978115e

44 files changed

Lines changed: 4295 additions & 4923 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.shp filter=lfs diff=lfs merge=lfs -text
2+
*.dbf filter=lfs diff=lfs merge=lfs -text
3+
*.shx filter=lfs diff=lfs merge=lfs -text
4+
*.cpg filter=lfs diff=lfs merge=lfs -text
5+
*.prj filter=lfs diff=lfs merge=lfs -text

.github/workflows/codeql.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Advanced"
13+
14+
on:
15+
push:
16+
branches: [ "main", "development" ]
17+
pull_request:
18+
branches: [ "main", "development" ]
19+
# schedule:
20+
# - cron: '44 14 * * 1'
21+
workflow_dispatch:
22+
23+
24+
jobs:
25+
analyze:
26+
name: Analyze (${{ matrix.language }})
27+
# Runner size impacts CodeQL analysis time. To learn more, please see:
28+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
29+
# - https://gh.io/supported-runners-and-hardware-resources
30+
# - https://gh.io/using-larger-runners (GitHub.com only)
31+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
32+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
33+
permissions:
34+
# required for all workflows
35+
security-events: write
36+
37+
# required to fetch internal or private CodeQL packs
38+
packages: read
39+
40+
# only required for workflows in private repositories
41+
actions: read
42+
contents: read
43+
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
include:
48+
- language: python
49+
build-mode: none
50+
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
51+
# Use `c-cpp` to analyze code written in C, C++ or both
52+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
53+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
54+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
55+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
56+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
57+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v4
61+
62+
# Initializes the CodeQL tools for scanning.
63+
- name: Initialize CodeQL
64+
uses: github/codeql-action/init@v3
65+
with:
66+
languages: ${{ matrix.language }}
67+
build-mode: ${{ matrix.build-mode }}
68+
# If you wish to specify custom queries, you can do so here or in a config file.
69+
# By default, queries listed here will override any specified in a config file.
70+
# Prefix the list here with "+" to use these queries and those in the config file.
71+
72+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
73+
# queries: security-extended,security-and-quality
74+
75+
# If the analyze step fails for one of the languages you are analyzing with
76+
# "We were unable to automatically build your code", modify the matrix above
77+
# to set the build mode to "manual" for that language. Then modify this step
78+
# to build your code.
79+
# ℹ️ Command-line programs to run using the OS shell.
80+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
81+
- if: matrix.build-mode == 'manual'
82+
shell: bash
83+
run: |
84+
echo 'If you are using a "manual" build mode for one or more of the' \
85+
'languages you are analyzing, replace this with the commands to build' \
86+
'your code, for example:'
87+
echo ' make bootstrap'
88+
echo ' make release'
89+
exit 1
90+
91+
- name: Perform CodeQL Analysis
92+
uses: github/codeql-action/analyze@v3
93+
with:
94+
category: "/language:${{matrix.language}}"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Require Branch to Be Up-to-Date
2+
3+
# Trigger this workflow on pull request events targeting a specific branch.
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
- development
9+
10+
workflow_dispatch: # enables manual triggering
11+
12+
jobs:
13+
check-branch:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Determine Comparison Branch
17+
id: comparison
18+
run: |
19+
if [[ "${{ github.event.pull_request.base.ref }}" == "main" && "${{ github.event.pull_request.head.ref }}" == "development" ]]; then
20+
echo "branch=main" >> $GITHUB_ENV
21+
else
22+
echo "branch=development" >> $GITHUB_ENV
23+
fi
24+
25+
- name: Checkout pull request branch
26+
uses: actions/checkout@v3
27+
with:
28+
ref: ${{ github.event.pull_request.head.ref }}
29+
30+
- name: Fetch comparison branch
31+
run: |
32+
git fetch --unshallow
33+
git fetch origin ${{ env.branch }}
34+
35+
- name: Compare branch with ${{ env.branch }}
36+
run: |
37+
if git merge-base --is-ancestor origin/${{ env.branch }} HEAD; then
38+
echo "::notice ::Branch is up-to-date with ${{ env.branch }}."
39+
else
40+
echo "::error ::Merge Blocked: Your branch is behind the latest commits on ${{ env.branch }}. Please update your branch before attempting to merge."
41+
42+
exit 1
43+
fi
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish Package
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
workflow_dispatch: # enables manual triggering
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: "3.11"
21+
22+
- name: Install Poetry
23+
run: |
24+
curl -sSL https://install.python-poetry.org | python3 -
25+
26+
- name: Install Dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install toml requests packaging
30+
31+
- name: Validate Version
32+
run: |
33+
latest_version=$(curl -s https://pypi.org/pypi/views-pipeline-core/json | jq -r .info.version)
34+
new_version=$(python -c "import toml; print(toml.load('pyproject.toml')['tool']['poetry']['version'])")
35+
python -c "from packaging.version import parse; assert parse('$new_version') > parse('$latest_version'), 'Version must be higher than $latest_version'"
36+
37+
- name: Publish to PyPI
38+
run: poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }}

.github/workflows/run_pytest.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Run Pytest
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- development
8+
pull_request:
9+
branches:
10+
- main
11+
- development
12+
workflow_dispatch:
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v3
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: "3.11"
26+
27+
- name: Install Poetry
28+
run: |
29+
curl -sSL https://install.python-poetry.org | python3 -
30+
31+
- name: Install dependencies
32+
run: |
33+
poetry install
34+
35+
- name: Run tests
36+
run: |
37+
set -e
38+
poetry run pytest tests/

0 commit comments

Comments
 (0)