Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/LicenseChecks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 📃 License Checks
on:
pull_request:
push:
branches: [main, master]
jobs:
ensure-license-header:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: bash scripts/license_check.sh
21 changes: 6 additions & 15 deletions .github/workflows/LoadSchema.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
name: PostGIS Load Test

name: 🏋🏽 PostGIS Load Test
on:
push:
paths:
- '**'
#- 'sql/**.sql'
#- '.github/workflows/sql-lint-and-load.yml'
#- 'load_schema.sh'
# - 'sql/**.sql'
# - '.github/workflows/sql-lint-and-load.yml'
# - 'load_schema.sh'
pull_request:
paths:
- 'sql/**.sql'
- '.github/workflows/sql-lint-and-load.yml'
- 'load_schema.sh'
workflow_dispatch:

jobs:
postgis-load:
runs-on: ubuntu-latest
Expand All @@ -27,25 +25,18 @@ jobs:
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=10s
--health-timeout=5s
--health-retries=5

--health-cmd="pg_isready -U postgres" --health-interval=10s --health-timeout=5s --health-retries=5
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Wait for Postgres to be ready
run: |
for i in {1..30}; do
for _ in {1..30}; do
pg_isready -h localhost -U postgres && break
sleep 2
done

- name: Install PostgreSQL client
run: sudo apt-get update && sudo apt-get install -y postgresql-client

- name: Run load_schema.sh
env:
PGHOST: localhost
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/MarkdownChecks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: ✏️ Markdown Checks
on:
pull_request:
push:
branches: [main, master]
jobs:
markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm install -g markdownlint-cli
- run: markdownlint '**/*.md'
43 changes: 43 additions & 0 deletions .github/workflows/PythonChecks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 🐍 Python Checks
on:
pull_request:
push:
branches: [main, master]
jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install black
- run: black --check --diff .
ensure-utf8-encoding:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: bash scripts/encoding_check.sh
ensure-google-docstrings:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: bash scripts/docstrings_check.sh
test-count-feedback:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install -r requirements.txt || true
- run: python scripts/commit_test_stats.py
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install isort
- run: isort --check --diff .
11 changes: 11 additions & 0 deletions .github/workflows/QAChecks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: ⚒️ QA Checks
on:
pull_request:
push:
branches: [main, master]
jobs:
code-size-feedback:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: bash scripts/codebase_size_check.sh
24 changes: 24 additions & 0 deletions .github/workflows/SQLChecks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Pre-commit Checks
on:
pull_request:
push:
branches: [main, master]
jobs:
sqlfluff-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install sqlfluff
- run: sqlfluff lint sql/
sqlfluff-fix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install sqlfluff
- run: sqlfluff fix --force --check sql/
35 changes: 0 additions & 35 deletions .github/workflows/SQLFluff.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/SpellCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Pre-commit Checks
on:
pull_request:
push:
branches: [main, master]
jobs:
cspell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm install -g cspell
- run: cspell --no-progress --no-summary '**/*.md'
34 changes: 34 additions & 0 deletions .github/workflows/YamlChecks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 🗜️ Yaml Checks
on:
pull_request:
push:
branches: [main, master]
jobs:
yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pip install yamllint
- run: yamllint .
yamlfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install yamlfmt
run: sudo snap install yamlfmt
- name: Run yamlfmt
run: |
find . -name '*.yaml' -o -name '*.yml' | while read -r f; do
# Skip empty files
if [ ! -s "$f" ]; then
echo "🦘 Skipping empty file: $f"
continue
fi
# Skip files with only whitespace/comments
if ! grep -q '[^[:space:]#]' "$f"; then
echo "🦘 Skipping file containing only whitespace or comments: $f"
continue
fi
echo "⚒️ Formatting yaml file: $f"
yamlfmt "$f"
done
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,6 @@ history.gif
pgdata/

presentations/*.html


scripts/.test_stats.json
2 changes: 2 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MD013: false # allow long lines
MD033: false # allow inline HTML
52 changes: 35 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ repos:
language_version: python3
additional_dependencies: []
args: [sql]

- repo: https://github.com/sqlfluff/sqlfluff
rev: 3.0.7
hooks:
Expand All @@ -21,7 +20,6 @@ repos:
entry: sqlfluff fix --force
language: python
types: [sql]

- repo: local
hooks:
- id: remove-core-file
Expand All @@ -30,7 +28,6 @@ repos:
language: system
stages:
- pre-commit

- repo: local
hooks:
- id: ensure-utf8-encoding
Expand All @@ -39,7 +36,6 @@ repos:
language: system
types: [python]
stages: [pre-commit]

- repo: local
hooks:
- id: ensure-license-header
Expand All @@ -48,7 +44,6 @@ repos:
language: system
types: [python, shell, sql]
stages: [pre-commit]

- repo: local
hooks:
- id: ensure-google-docstrings
Expand All @@ -57,15 +52,13 @@ repos:
language: system
types: [python]
stages: [pre-commit]

- repo: local
hooks:
- id: code-size-feedback
name: "📏 Code Size Feedback"
entry: bash scripts/codebase_size_check.sh
language: system
stages: [pre-commit]

stages: [pre-commit]
- repo: local
hooks:
- id: test-count-feedback
Expand All @@ -74,7 +67,6 @@ repos:
language: system
types: [python]
stages: [pre-commit]

- repo: https://github.com/PyCQA/isort
rev: 6.0.1
hooks:
Expand All @@ -84,19 +76,45 @@ repos:
language: python
types: [python]
stages: [pre-commit]

- repo: local
hooks:
- id: nixfmt
name: nixfmt (RFC style)
name: "❄️ Nixfmt (RFC style)"
description: Format Nix code with nixfmt-rfc-style
entry: nixfmt
language: system
args: ["--"]
types: [nix]
exclude: >
(?x)^(
nix/sources.nix|
test_data/.*
)$

- repo: local
hooks:
- id: markdownlint
name: "📝 markdownlint - Markdown linter"
entry: markdownlint
language: system
types: [markdown]
stages: [pre-commit]
- repo: local
hooks:
- id: cspell
name: "🔤 cspell - Spell checker for Markdown"
entry: cspell --no-progress --no-summary
language: system
types: [markdown]
stages: [pre-commit]
- repo: local
hooks:
- id: yamllint
name: "🔍 yamllint - YAML linter"
entry: yamllint
language: system
types: [yaml]
stages: [pre-commit]
- repo: local
hooks:
- id: actionlint
name: "🤖 actionlint - GitHub Actions workflow linter"
entry: actionlint
language: system
types: [yaml]
files: ^\.github/workflows/.*\.ya?ml$
stages: [pre-commit]
2 changes: 2 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rules:
document-start: disable
Loading