fix invalid Lat/Lng data breaking the map and enforce proper value ra⦠#1862
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: ποΈ Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| pull_request: {} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| actions: write | |
| contents: read | |
| packages: write | |
| jobs: | |
| lint: | |
| name: ⬣ Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: β¬οΈ Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: β Setup node | |
| uses: actions/setup-node@v6 | |
| with: | |
| cache: npm | |
| cache-dependency-path: ./package.json | |
| node-version-file: .nvmrc | |
| - name: π₯ Install deps | |
| run: npm install | |
| - name: π¬ Lint | |
| run: npm run lint | |
| typecheck: | |
| name: Κ¦ TypeScript | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: β¬οΈ Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: β Setup node | |
| uses: actions/setup-node@v6 | |
| with: | |
| cache: npm | |
| cache-dependency-path: ./package.json | |
| node-version-file: .nvmrc | |
| - name: π₯ Install deps | |
| run: npm install | |
| - name: π Type check | |
| run: npm run typecheck --if-present | |
| vitest: | |
| name: β‘ Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: β¬οΈ Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: π Copy test env vars | |
| run: cp .env.example .env | |
| - name: β Setup node | |
| uses: actions/setup-node@v6 | |
| with: | |
| cache: npm | |
| cache-dependency-path: ./package.json | |
| node-version-file: .nvmrc | |
| - name: π₯ Install deps | |
| run: npm install | |
| - name: π³ Docker compose | |
| # we need a postgres container for runnign the tests | |
| # the sleep is just there to give time for postgres to get started | |
| run: docker compose -f docker-compose.ci.yml up -d && sleep 30 | |
| env: | |
| DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/postgres" | |
| - name: π Setup Database | |
| uses: nick-fields/[email protected] | |
| with: | |
| timeout_minutes: 10 | |
| max_attempts: 5 | |
| retry_wait_seconds: 45 | |
| retry_on: error | |
| command: npm run db:migrate | |
| - name: β‘ Run vitest | |
| run: npm run test:coverage | |
| - name: π§ Report Coverage | |
| uses: davelosert/vitest-coverage-report-action@v2 | |
| - name: ποΈ Cleanup | |
| if: always() | |
| run: docker compose down | |
| build: | |
| name: π³ Build | |
| # only build/deploy main branch on pushes | |
| # if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: β¬οΈ Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: π³ Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| version: v0.9.1 | |
| # Setup cache | |
| - name: β‘οΈ Cache Docker layers | |
| uses: actions/cache@v5 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: ${{ runner.os }}-buildx-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-buildx- | |
| - name: π Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/opensensemap/frontend | |
| - name: π GitHub Registry Auth | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: π³ Docker build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./other/Dockerfile | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| COMMIT_SHA=${{ github.sha }} | |
| cache-from: type=local,src=/tmp/.buildx-cache | |
| cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new | |
| # This ugly bit is necessary if you don't want your cache to grow forever | |
| # till it hits GitHub's limit of 5GB. | |
| # Temp fix | |
| # https://github.com/docker/build-push-action/issues/252 | |
| # https://github.com/moby/buildkit/issues/1896 | |
| - name: π Move cache | |
| run: | | |
| rm -rf /tmp/.buildx-cache | |
| mv /tmp/.buildx-cache-new /tmp/.buildx-cache |