-
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.
Merge branch 'main' of github.com:hotosm/fmtm-splitter
Sync with upstream
- Loading branch information
Showing
27 changed files
with
1,895 additions
and
275 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,9 @@ | ||
# Ignore everything | ||
** | ||
|
||
# Allow files and directories | ||
!fmtm_splitter | ||
!pyproject.toml | ||
!pdm.lock | ||
!README.md | ||
!LICENSE.md |
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,54 @@ | ||
name: Build and Deploy | ||
|
||
on: | ||
# Push includes PR merge | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
# Workflow is triggered only if src changes | ||
- "src/**" | ||
# Allow manual trigger | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
GIT_BRANCH: ${{ github.ref_name }} | ||
|
||
jobs: | ||
build-and-push-images: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: ${{ github.ref_name }} | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract version | ||
id: extract_api_version | ||
run: | | ||
cd src/backend | ||
echo "PKG_VERSION=$(python -c 'from app.__version__ import __version__; print(__version__)')" >> $GITHUB_ENV | ||
- name: Build image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
target: prod | ||
push: true | ||
tags: | | ||
"ghcr.io/hotosm/fmtm/fmtm-splitter:${{ env.PKG_VERSION }}" | ||
"ghcr.io/hotosm/fmtm/fmtm-splitter:latest" | ||
build-args: | | ||
PKG_VERSION=${{ env.PKG_VERSION }} |
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,44 @@ | ||
name: Publish Docs | ||
|
||
on: | ||
push: | ||
paths: | ||
- docs/** | ||
- fmtm_splitter/** | ||
branches: [main] | ||
# Allow manual trigger (workflow_dispatch) | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
publish_docs: | ||
name: Publish Docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | ||
|
||
- name: Read cache | ||
uses: actions/cache@v3 | ||
with: | ||
key: mkdocs-material-${{ env.cache_id }} | ||
path: .cache | ||
restore-keys: | | ||
mkdocs-material- | ||
- name: Install PDM | ||
run: | | ||
python3 -m pip install pdm | ||
- name: Publish | ||
run: | | ||
pdm install -G docs --no-default | ||
pdm run mkdocs gh-deploy --force |
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,35 @@ | ||
name: pytest | ||
|
||
on: | ||
# Run tests on all pushed branches | ||
push: | ||
branches: | ||
- "*" | ||
# Run tests on PR, prior to merge to main & development. | ||
pull_request: | ||
branches: | ||
- main | ||
# Allow manual trigger (workflow_dispatch) | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: ${{ github.ref_name }} | ||
|
||
container: | ||
image: ghcr.io/hotosm/fmtm-splitter:ci | ||
volumes: | ||
# Mount / test files in commit | ||
- ./fmtm_splitter:/home/appuser/.local/lib/python3.10/site-packages/fmtm_splitter | ||
- ./tests:/home/appuser/tests | ||
options: --user root | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Run pytest as appuser | ||
run: gosu appuser pytest |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,64 @@ | ||
# gdb_history | ||
TAGS | ||
*~ | ||
.deps | ||
.libs | ||
py-compile | ||
NEWS | ||
*__pycache__/ | ||
|
||
# output files | ||
*.osm | ||
*.txt | ||
*.xml | ||
*.geojson | ||
*.pbf | ||
*.xml | ||
*.html | ||
*.mbtiles | ||
*.sqlitedb | ||
|
||
# Prerequisites | ||
*.d | ||
|
||
# Compiled Object files | ||
*.slo | ||
*.lo | ||
*.o | ||
*.obj | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Compiled Dynamic libraries | ||
*.so | ||
*.dylib | ||
*.dll | ||
|
||
# Fortran module files | ||
*.mod | ||
*.smod | ||
|
||
# Compiled Static libraries | ||
*.lai | ||
*.la | ||
*.a | ||
*.lib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
|
||
# PDM | ||
.pdm.toml | ||
.pdm-python | ||
|
||
# Python builds | ||
build | ||
dist | ||
|
||
# Docs | ||
site |
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,35 @@ | ||
repos: | ||
# Versioning: Commit messages & changelog | ||
- repo: https://github.com/commitizen-tools/commitizen | ||
rev: v3.6.0 | ||
hooks: | ||
- id: commitizen | ||
stages: [commit-msg] | ||
|
||
# Autoformat: Python code | ||
- repo: https://github.com/psf/black | ||
rev: 23.7.0 | ||
hooks: | ||
- id: black | ||
|
||
# Lint / autoformat: Python code | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
# Ruff version. | ||
rev: "v0.0.285" | ||
hooks: | ||
- id: ruff | ||
args: [--exit-non-zero-on-fix] | ||
|
||
# Autoformat: YAML, JSON, Markdown, etc. | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v3.0.2 | ||
hooks: | ||
- id: prettier | ||
args: [--ignore-unknown, --no-error-on-unmatched-pattern, "!chart/**"] | ||
|
||
# Lint: Markdown | ||
- repo: https://github.com/igorshubovych/markdownlint-cli | ||
rev: v0.35.0 | ||
hooks: | ||
- id: markdownlint | ||
args: [--fix] |
Oops, something went wrong.