feat: add ISO country codes reference table and update ETL processes #10
This file contains hidden or 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
| name: Quality Tests | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| jobs: | |
| shellcheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive # Important: checkout submodules | |
| - name: Install shellcheck | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y shellcheck | |
| - name: Run shellcheck on Analytics scripts | |
| run: | | |
| echo "Running shellcheck on Analytics-specific scripts..." | |
| find bin/dwh -name "*.sh" -type f -exec shellcheck -x -o all {} \; | |
| - name: Run shellcheck on Common submodule (integration check) | |
| run: | | |
| echo "Running shellcheck on Common submodule in Analytics context..." | |
| # This detects integration issues with Common functions | |
| find lib/osm-common -name "*.sh" -type f -exec shellcheck -x -o all {} \; || { | |
| echo "⚠️ Warning: Common submodule has shellcheck issues in Analytics context" | |
| echo "Note: This may indicate integration problems, not necessarily bugs in Common" | |
| exit 0 # Don't fail - Common is maintained in Profile repo | |
| } | |
| shfmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install shfmt | |
| run: | | |
| # Install from GitHub releases | |
| wget -q -O shfmt https://github.com/mvdan/sh/releases/download/v3.7.0/shfmt_v3.7.0_linux_amd64 | |
| chmod +x shfmt | |
| sudo mv shfmt /usr/local/bin/ | |
| shfmt -version | |
| - name: Check Analytics code formatting | |
| run: | | |
| echo "Checking Analytics code formatting (shfmt -i 1 -sr -bn)..." | |
| find bin/dwh -name "*.sh" -type f -exec shfmt -d -i 1 -sr -bn {} \; | |
| - name: Check Common code formatting (integration check) | |
| run: | | |
| echo "Checking Common code formatting in Analytics context..." | |
| find lib/osm-common -name "*.sh" -type f -exec shfmt -d -i 1 -sr -bn {} \; || { | |
| echo "⚠️ Warning: Common submodule formatting issues in Analytics context" | |
| exit 0 # Don't fail | |
| } | |
| code-quality: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Check for common issues in Analytics scripts | |
| run: | | |
| echo "Checking for common code quality issues..." | |
| # Check for trailing whitespace | |
| echo "Checking trailing whitespace..." | |
| if find bin/dwh -name "*.sh" -type f -exec grep -l " $" {} \; 2>/dev/null; then | |
| echo "⚠️ Found trailing whitespace in Analytics scripts" | |
| else | |
| echo "✓ No trailing whitespace found" | |
| fi | |
| # Check for proper shebang | |
| echo "Checking shebangs..." | |
| find bin/dwh -name "*.sh" -type f -exec head -1 {} \; | grep -v "#!/bin/bash" && { | |
| echo "⚠️ Found scripts without proper shebang" | |
| } || echo "✓ All shebangs correct" | |
| # Check for TODO/FIXME comments | |
| echo "Checking for TODO/FIXME comments..." | |
| TODO_COUNT=$(find bin/dwh -name "*.sh" -type f -exec grep -c "TODO\|FIXME" {} \; 2>/dev/null | awk '{s+=$1} END {print s}') | |
| echo "Found ${TODO_COUNT} TODO/FIXME comments" | |
| - name: Generate quality report | |
| if: always() | |
| run: | | |
| echo "## Quality Test Results - Analytics" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Tests Performed:" >> $GITHUB_STEP_SUMMARY | |
| echo "- ✅ Shellcheck (Analytics scripts in bin/dwh/)" >> $GITHUB_STEP_SUMMARY | |
| echo "- ✅ Shellcheck (Common submodule - integration check)" >> $GITHUB_STEP_SUMMARY | |
| echo "- ✅ Shfmt (code formatting)" >> $GITHUB_STEP_SUMMARY | |
| echo "- ✅ Code quality checks" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Scope:" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Analytics Scripts:** bin/dwh/" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Common Submodule:** lib/osm-common/ (tested in context)" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Note:" >> $GITHUB_STEP_SUMMARY | |
| echo "The Common submodule is also tested in OSM-Notes-profile," >> $GITHUB_STEP_SUMMARY | |
| echo "ensuring cross-project compatibility." >> $GITHUB_STEP_SUMMARY | |