Stop area relations with only stops or platforms should be imported (… #1993
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: Test | |
| on: | |
| workflow_dispatch: ~ | |
| push: | |
| branches: | |
| - master | |
| pull_request: ~ | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref_name != 'master' }} | |
| jobs: | |
| import: | |
| name: Import data | |
| strategy: | |
| matrix: | |
| runs-on: | |
| - ubuntu-24.04 | |
| - ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runs-on }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Get Date | |
| id: get-date | |
| shell: bash | |
| run: | | |
| echo "date=$(/bin/date -u "+%Y%m")" >> $GITHUB_OUTPUT | |
| - name: Cache data | |
| uses: actions/cache@v4 | |
| id: cache-data | |
| with: | |
| path: | | |
| data/berlin.osm.pbf | |
| data/filtered/berlin.osm.pbf | |
| key: data-${{ steps.get-date.outputs.date }}-berlin | |
| enableCrossOsArchive: true | |
| - name: Download Berlin | |
| if: ${{ steps.cache-data.outputs.cache-hit != 'true' }} | |
| run: | | |
| curl --location --fail --output data/berlin.osm.pbf https://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf | |
| - name: Start database | |
| env: | |
| OSM2PGSQL_DATAFILE: berlin.osm.pbf | |
| run: | | |
| docker compose build db | |
| docker compose up --no-build --wait db | |
| - name: Build import image | |
| run: | | |
| docker compose build import | |
| if [[ "${{ github.ref_name }}" = "master" ]]; then | |
| docker compose push import | |
| fi | |
| - name: Import data | |
| env: | |
| OSM2PGSQL_DATAFILE: berlin.osm.pbf | |
| run: | | |
| docker compose run import import | |
| - name: Prepare and save database image | |
| run: | | |
| docker compose stop db | |
| DB_CONTAINER_ID="$(docker compose ps --all --format json | jq -r 'select(.Service == "db") | .ID')" | |
| docker commit "$DB_CONTAINER_ID" ghcr.io/hiddewie/openrailwaymap-import-db:latest | |
| docker save ghcr.io/hiddewie/openrailwaymap-import-db:latest > ${{ runner.temp }}/openrailwaymap-import-db.tar | |
| - name: Upload database artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ runner.arch }}-openrailwaymap-import-db | |
| path: ${{ runner.temp }}/openrailwaymap-import-db.tar | |
| test-import: | |
| name: Test import | |
| strategy: | |
| matrix: | |
| runs-on: | |
| - ubuntu-24.04 | |
| - ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runs-on }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build import image | |
| run: | | |
| docker build --file import/Dockerfile --target test --tag import-test . | |
| - name: Run import tests | |
| run: | | |
| docker run --rm import-test | |
| build-api: | |
| name: Build API | |
| strategy: | |
| matrix: | |
| runs-on: | |
| - ubuntu-24.04 | |
| - ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runs-on }} | |
| needs: | |
| - import | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build API | |
| run: | | |
| docker compose build api | |
| - name: Save API image | |
| run: | | |
| docker save ghcr.io/hiddewie/openrailwaymap-api:latest > ${{ runner.temp }}/openrailwaymap-api.tar | |
| - name: Upload API artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ runner.arch }}-openrailwaymap-api | |
| path: ${{ runner.temp }}/openrailwaymap-api.tar | |
| test-api: | |
| name: Test API | |
| strategy: | |
| matrix: | |
| runs-on: | |
| - ubuntu-24.04 | |
| - ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runs-on }} | |
| needs: | |
| - build-api | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Download database artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ runner.arch }}-openrailwaymap-import-db | |
| path: ${{ runner.temp }} | |
| - name: Load database image | |
| run: | | |
| cat ${{ runner.temp }}/openrailwaymap-import-db.tar | docker load | |
| - name: Download API artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ runner.arch }}-openrailwaymap-api | |
| path: ${{ runner.temp }} | |
| - name: Load API image | |
| run: | | |
| cat ${{ runner.temp }}/openrailwaymap-api.tar | docker load | |
| - name: Start database | |
| run: | | |
| docker compose up --no-build --wait db | |
| - name: Start API | |
| run: | | |
| docker compose up --wait --no-build api | |
| - name: Run API tests | |
| working-directory: api | |
| run: | | |
| docker run --rm --net host -v "$PWD/test/api.hurl:/hurl/api.hurl" ghcr.io/orange-opensource/hurl:6.1.1 --test --verbose --variable base_url=http://localhost:5000/api /hurl/api.hurl | |
| - name: Print logs | |
| if: always() | |
| run: | | |
| docker compose logs | |
| test-proxy: | |
| name: Test proxy | |
| strategy: | |
| matrix: | |
| runs-on: | |
| - ubuntu-24.04 | |
| - ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runs-on }} | |
| needs: | |
| - import | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Download database artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ runner.arch }}-openrailwaymap-import-db | |
| path: ${{ runner.temp }} | |
| - name: Load database image | |
| run: | | |
| cat ${{ runner.temp }}/openrailwaymap-import-db.tar | docker load | |
| - name: Start database | |
| run: | | |
| docker compose up --no-build --wait db | |
| - name: Start tile server | |
| run: | | |
| docker compose build martin | |
| docker compose up --no-build --detach martin | |
| - name: Start web server | |
| run: | | |
| docker compose build martin-proxy | |
| docker compose up --no-build --wait martin-proxy | |
| - name: Run proxy tests | |
| working-directory: proxy | |
| run: | | |
| docker run --rm --net host -v "$PWD/test/proxy.hurl:/hurl/proxy.hurl" ghcr.io/orange-opensource/hurl:6.1.1 --test --verbose --variable base_url=http://localhost:8000 /hurl/proxy.hurl | |
| - name: Download preset | |
| if: always() | |
| run: | | |
| curl -sSf -o preset.zip http://localhost:8000/preset.zip | |
| - name: Store preset | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: ${{ runner.arch }}-presets | |
| path: preset.zip | |
| if-no-files-found: warn | |
| - name: Print logs | |
| if: always() | |
| run: | | |
| docker compose logs | |
| test-ui: | |
| name: Test UI | |
| strategy: | |
| matrix: | |
| runs-on: | |
| - ubuntu-24.04 | |
| - ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runs-on }} | |
| needs: | |
| - test-proxy | |
| - test-api | |
| - build-api | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Download database artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ runner.arch }}-openrailwaymap-import-db | |
| path: ${{ runner.temp }} | |
| - name: Load database image | |
| run: | | |
| cat ${{ runner.temp }}/openrailwaymap-import-db.tar | docker load | |
| - name: Download API artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ runner.arch }}-openrailwaymap-api | |
| path: ${{ runner.temp }} | |
| - name: Load API image | |
| run: | | |
| cat ${{ runner.temp }}/openrailwaymap-api.tar | docker load | |
| - name: Start database | |
| run: | | |
| docker compose up --no-build --wait db | |
| - name: Start tile server | |
| run: | | |
| docker compose build martin | |
| docker compose up --no-build --detach martin | |
| - name: Start web server | |
| run: | | |
| docker compose build martin-proxy | |
| docker compose up --no-build --wait martin-proxy | |
| - name: Start API | |
| run: | | |
| docker compose up --wait --no-build api | |
| - name: Run UI tests | |
| uses: cypress-io/github-action@v6 | |
| with: | |
| working-directory: proxy/test/ui | |
| browser: ${{ runner.arch == 'X64' && 'chrome' || 'firefox' }} | |
| - name: Store screenshots | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: ${{ runner.arch }}-screenshots | |
| path: proxy/test/ui/cypress/screenshots | |
| if-no-files-found: warn |