Add test running simulation for taxis #2100
Workflow file for this run
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: UI | |
| defaults: | |
| run: | |
| shell: bash -ieo pipefail {0} | |
| on: | |
| push: | |
| branches: [ "master", "deploy" ] | |
| pull_request: | |
| branches: [ "master", "deploy" ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ['self-hosted', 'prima', 'Linux', 'X64'] | |
| permissions: write-all | |
| env: | |
| DATABASE_URL: postgresql://postgres:pw@localhost:6500/prima | |
| PUBLIC_MOTIS_URL: https://prima-motis-staging.motis-project.de | |
| TZ: Europe/Berlin | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Cleanup docker cache | |
| run: | | |
| docker image prune -f | |
| docker builder prune -f | |
| - name: Install Dependencies | |
| run: pnpm install | |
| - name: Code Lint | |
| run: pnpm run lint | |
| - name: Svelte Check | |
| run: pnpm run check | |
| - name: Install Playwright Dependencies | |
| run: npx playwright install | |
| - name: Docker Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Integration Tests | |
| run: | | |
| docker compose down | |
| docker compose pull motis-server pg | |
| ./motis-import.sh | |
| docker compose up -d motis-server pg | |
| sleep 5 | |
| ./setup-db.sh | |
| npx playwright test | |
| - name: Unit Tests | |
| run: | | |
| docker compose up -d pg | |
| sleep 5 | |
| ./setup-db.sh | |
| pnpm run dev & | |
| pnpm run test:unit | |
| - name: Shutdown | |
| if: always() | |
| run: docker compose down | |
| - name: Upload screenshots | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: screenshots | |
| path: screenshots/ | |
| - name: Release Build | |
| run: pnpm run build | |
| - name: Docker setup-buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| install: true | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=edge | |
| - name: Docker build and push | |
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/deploy' | |
| uses: docker/build-push-action@v5 | |
| with: | |
| push: true | |
| context: . | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| platforms: linux/amd64,linux/arm64 | |
| deploy: | |
| if: github.ref == 'refs/heads/master' | |
| runs-on: ['self-hosted', 'prima', 'Linux', 'X64'] | |
| needs: build | |
| steps: | |
| - name: Deploy | |
| run: | | |
| cd /home/prima/prima-staging | |
| docker compose pull | |
| docker compose down | |
| docker compose up -d |